Spaces:
Running
Running
ZhangYuhan
commited on
update server
Browse files- constrants.py +28 -0
- model/model_worker.py +1 -8
constrants.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from pathlib import Path
|
3 |
+
|
4 |
+
os.chdir(Path.cwd())
|
5 |
+
|
6 |
+
LOGDIR = os.getenv("LOGDIR", "./3DGen-Arena-logs/vote_log")
|
7 |
+
IMAGE_DIR = os.getenv("IMAGE_DIR", f"{LOGDIR}/images")
|
8 |
+
OFFLINE_DIR = "./offline"
|
9 |
+
OFFLINE_GIF_DIR = os.path.join(OFFLINE_DIR, "gifs")
|
10 |
+
|
11 |
+
SERVER_PORT = os.getenv("SERVER_PORT", 7860)
|
12 |
+
ROOT_PATH = os.getenv("ROOT_PATH", None)
|
13 |
+
ELO_RESULTS_DIR = os.getenv("ELO_RESULTS_DIR", "./arena_elo/results/latest")
|
14 |
+
|
15 |
+
LOG_SERVER = os.getenv("LOG_SERVER", "https://tigerai.ca")
|
16 |
+
LOG_SERVER_SUBDOAMIN = os.getenv("LOG_SERVER_SUBDIR", "GenAI-Arena-hf-logs")
|
17 |
+
LOG_SERVER_ADDR = os.getenv("LOG_SERVER_ADDR", f"{LOG_SERVER}/{LOG_SERVER_SUBDOAMIN}")
|
18 |
+
# LOG SERVER API ENDPOINTS
|
19 |
+
APPEND_JSON = "append_json"
|
20 |
+
SAVE_IMAGE = "save_image"
|
21 |
+
SAVE_LOG = "save_log"
|
22 |
+
|
23 |
+
NUM_SIDES = 2
|
24 |
+
TEXT_PROMPT_PATH = "offline/prompts_110.json"
|
25 |
+
IMAGE_PROMPT_PATH = "offline/image_urls.txt"
|
26 |
+
|
27 |
+
MAX_ATTEMPTS = 5
|
28 |
+
REPLICATE_API_TOKEN = os.getenv("REPLICATE_API_TOKEN", "r8_0BaoQW0G8nWFXY8YWBCCUDurANxCtY72rarv9")
|
model/model_worker.py
CHANGED
@@ -6,14 +6,7 @@ from typing import List
|
|
6 |
import replicate
|
7 |
import subprocess
|
8 |
|
9 |
-
|
10 |
-
sys.path.append("..")
|
11 |
-
|
12 |
-
from gradio_client import Client
|
13 |
-
from constants import OFFLINE_GIF_DIR, MAX_ATTEMPTS, REPLICATE_API_TOKEN
|
14 |
-
from .client import Gau2Mesh_client
|
15 |
-
|
16 |
-
# os.environ["REPLICATE_API_TOKEN"] = REPLICATE_API_TOKEN
|
17 |
|
18 |
class BaseModelWorker:
|
19 |
def __init__(self,
|
|
|
6 |
import replicate
|
7 |
import subprocess
|
8 |
|
9 |
+
# os.environ("REPLICATE_API_TOKEN", "r8_0BaoQW0G8nWFXY8YWBCCUDurANxCtY72rarv9")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
class BaseModelWorker:
|
12 |
def __init__(self,
|