Spaces:
Runtime error
Runtime error
fix: use model_name instead of multiple secret variables
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ from utils import force_git_push
|
|
11 |
|
12 |
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
13 |
DATASET_REPO_URL = os.getenv("DATASET_REPO_URL")
|
14 |
-
|
15 |
FORCE_PUSH = os.getenv("FORCE_PUSH")
|
16 |
BOT_NAME = "PersianGPT-FT"
|
17 |
PUSH_FREQUENCY = 60 # every minute
|
@@ -23,8 +23,8 @@ NAME = ""
|
|
23 |
|
24 |
REVISION = "4f68dc3740b410835da71811d92bd3b2d690e79c"
|
25 |
#API_URL = os.environ.get("API_URL", None)
|
26 |
-
API_URL = f"https://api-inference.huggingface.co/models/{
|
27 |
-
|
28 |
|
29 |
DATA_FILENAME = "data.jsonl"
|
30 |
DATA_FILE = os.path.join("data", DATA_FILENAME)
|
|
|
11 |
|
12 |
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
13 |
DATASET_REPO_URL = os.getenv("DATASET_REPO_URL")
|
14 |
+
MODEL_NAME = os.getenv("MODEL_NAME")
|
15 |
FORCE_PUSH = os.getenv("FORCE_PUSH")
|
16 |
BOT_NAME = "PersianGPT-FT"
|
17 |
PUSH_FREQUENCY = 60 # every minute
|
|
|
23 |
|
24 |
REVISION = "4f68dc3740b410835da71811d92bd3b2d690e79c"
|
25 |
#API_URL = os.environ.get("API_URL", None)
|
26 |
+
API_URL = f"https://api-inference.huggingface.co/models/{MODEL_NAME}/revision/{REVISION}" if len(REVISION)>0 else f"https://api-inference.huggingface.co/models/{MODEL_NAME}"
|
27 |
+
MODEL_REPO_URL = f"https://huggingface.co/{MODEL_NAME}"
|
28 |
|
29 |
DATA_FILENAME = "data.jsonl"
|
30 |
DATA_FILE = os.path.join("data", DATA_FILENAME)
|