vpcom commited on
Commit
6e0579e
·
1 Parent(s): 0c679be

fix: endpoint doesn't support the revision

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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}/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,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