6 Commits
v1.0.0 ... main

5 changed files with 49 additions and 2 deletions

View File

@@ -4,7 +4,6 @@ __pycache__/
*.pyd
.pytest_cache/
.env
config.local.json
state.db
/data/
.git/

View File

@@ -8,6 +8,7 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY app ./app
COPY seeds ./seeds
COPY scripts ./scripts
COPY config.local.json ./
EXPOSE 8080

View File

@@ -1,6 +1,9 @@
from app.clients.modelhub import ModelHubClient
from app.domain.vllm_configs import gen_vllm_config
from app.storage.repositories import Repository, future_seconds
import logging
LOG = logging.getLogger(__name__)
class Submitter:
@@ -13,6 +16,7 @@ class Submitter:
for task in self.repo.due_tasks(("ready_to_submit",), limit=limit):
config = gen_vllm_config(task["gpu_type"], task["model_id"], task["max_model_len"])
result = self.client.create_contest_task(task["model_id"], task["gpu_type"], config)
LOG.info("submit %s / %s / %s -> %s (%s)", task["model_id"], task["gpu_type"], task["source"], result.result, result.message)
self.repo.record_submission_attempt(
task["id"],
task["model_id"],

View File

@@ -10,7 +10,7 @@ def connect(db_path: str) -> sqlite3.Connection:
parent = os.path.dirname(os.path.abspath(db_path))
if parent and not os.path.exists(parent):
os.makedirs(parent, exist_ok=True)
conn = sqlite3.connect(db_path, timeout=30)
conn = sqlite3.connect(db_path, timeout=30, check_same_thread=False)
conn.row_factory = sqlite3.Row
conn.execute("PRAGMA journal_mode=WAL")
conn.execute("PRAGMA busy_timeout=30000")

43
config.local.json Normal file
View File

@@ -0,0 +1,43 @@
{
"AUTH_TOKEN": "41be3e6fd9644de1aabcd025cf5d6340",
"HF_TOKEN": "hf_kpVhngyUGLTUqkDChpDIYclRSXizluUpn",
"CONFTEST_API_TOKEN": "0f3c1fd38fbac493cf3760ce4aaeac90",
"EMAIL": "i-hengyan@4paradigm.com",
"USER_ID": "83",
"CONTRIBUTORS": "i-hengyan",
"STRATEGY_ID": "280bc4a7-a460-4778-bf74-89ccd3162bf5",
"MODELHUB_URL": "https://modelhub.org.cn",
"MODELHUB_API_BASE": "https://modelhub.org.cn/api",
"MODELHUB_ADMINAPI_BASE": "https://modelhub.org.cn/adminApi",
"DB_PATH": "./state.db",
"HOST": "0.0.0.0",
"PORT": 8080,
"SUBMIT_DRY_RUN": false,
"INJECT_STRATEGY_ID": true,
"CONTEST_TASK_STRATEGY_FIELD": "strategyId",
"MAX_USER_TASKS": 2000,
"MAX_SELF_DOWNLOADS": 8,
"POLL_INTERVAL_SECONDS": 60,
"DOWNLOAD_POLL_INTERVAL_SECONDS": 300,
"CRAWLER_REFRESH_SECONDS": 3600,
"DEFAULT_GPU_ALIASES": "910b,k100,p800,166m,bi100,bi150,c500,s4000,mrv100,mlu370-x4,mlu370-x8",
"DEFAULT_MAX_MODEL_LEN": 1024,
"ENABLE_NOT_ADAPTED_CRAWLER": true,
"TARGET_MACHINE_NAMES": "MTT S4000,Hygon K100,Kunlunxin P800",
"TARGET_TASK_LEVEL": "文本生成",
"MODELHUB_PAGE_SIZE": 100,
"CRAWLER_MAX_PAGES": 0,
"ENABLE_DOWNLOAD_SUCCESS_CRAWLER": true,
"DOWNLOAD_SUCCESS_PAGE_SIZE": 50,
"DOWNLOAD_SUCCESS_MAX_PAGES": 0,
"BOUNTY_ALLOW_DIRECT_SUBMIT": true,
"AUTO_LOAD_SEED_PATH": ""
}