Spaces:
Runtime error
Runtime error
fix: endpoint doesn't support the revision
Browse files
app.py
CHANGED
@@ -112,7 +112,7 @@ REPETITION_PENALTY = ""
|
|
112 |
MODEL_REPO_URL = f"https://huggingface.co/{MODEL_NAME}"
|
113 |
|
114 |
if len(ENDPOINT)>0:
|
115 |
-
API_URL = f"{ENDPOINT}
|
116 |
MODEL_VERSION = f"{ENDPOINT}" if len(REVISION)==0 else REVISION
|
117 |
else:
|
118 |
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}"
|
@@ -512,6 +512,7 @@ class InferenceClientUS(InferenceClient):
|
|
512 |
|
513 |
client = InferenceClientUS(
|
514 |
API_URL,
|
|
|
515 |
headers={"Authorization": f"Bearer {HF_TOKEN}"},
|
516 |
)
|
517 |
|
|
|
112 |
MODEL_REPO_URL = f"https://huggingface.co/{MODEL_NAME}"
|
113 |
|
114 |
if len(ENDPOINT)>0:
|
115 |
+
API_URL = f"{ENDPOINT}" #/revision/{REVISION}" if len(REVISION)>0 else f"{ENDPOINT}"
|
116 |
MODEL_VERSION = f"{ENDPOINT}" if len(REVISION)==0 else REVISION
|
117 |
else:
|
118 |
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}"
|
|
|
512 |
|
513 |
client = InferenceClientUS(
|
514 |
API_URL,
|
515 |
+
revision=REVISION,
|
516 |
headers={"Authorization": f"Bearer {HF_TOKEN}"},
|
517 |
)
|
518 |
|