Black Goku commited on
Commit
73d8db0
·
verified ·
1 Parent(s): e08f2a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -33,7 +33,10 @@ MAX_NEW_TOKENS = int(os.environ.get("MAX_NEW_TOKENS", "500"))
33
  API_KEY = os.environ.get("YAPPY_API_KEY", "")
34
  MAX_HISTORY_MESSAGES = int(os.environ.get("MAX_HISTORY_MESSAGES", "16"))
35
 
36
- client = InferenceClient(model=MODEL_ID, token=HF_TOKEN or None)
 
 
 
37
 
38
  # ---------------------------------------------------------------------------
39
  # Mode system prompts
@@ -148,7 +151,7 @@ class ChatRequest(BaseModel):
148
  # App
149
  # ---------------------------------------------------------------------------
150
 
151
- app = FastAPI(title="Yappy API", version="3.0.1")
152
 
153
  app.add_middleware(
154
  CORSMiddleware,
 
33
  API_KEY = os.environ.get("YAPPY_API_KEY", "")
34
  MAX_HISTORY_MESSAGES = int(os.environ.get("MAX_HISTORY_MESSAGES", "16"))
35
 
36
+ # provider="hf-inference" forces requests through router.huggingface.co
37
+ # instead of the legacy api-inference.huggingface.co domain, which has a
38
+ # known DNS resolution failure inside HF Space containers.
39
+ client = InferenceClient(model=MODEL_ID, token=HF_TOKEN or None, provider="hf-inference")
40
 
41
  # ---------------------------------------------------------------------------
42
  # Mode system prompts
 
151
  # App
152
  # ---------------------------------------------------------------------------
153
 
154
+ app = FastAPI(title="Yappy API", version="3.1.0")
155
 
156
  app.add_middleware(
157
  CORSMiddleware,