vpcom commited on
Commit
0c679be
·
1 Parent(s): 99d5d53

fix: support revision in the endpoint

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