Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,7 +25,7 @@ class MessageRequest(BaseModel):
|
|
| 25 |
message: str
|
| 26 |
language: str
|
| 27 |
|
| 28 |
-
repo_id = "
|
| 29 |
llm_client = InferenceClient(
|
| 30 |
model=repo_id,
|
| 31 |
token=os.getenv("HF_TOKEN"),
|
|
@@ -61,8 +61,8 @@ templates = Jinja2Templates(directory="static")
|
|
| 61 |
|
| 62 |
# Configure Llama index settings
|
| 63 |
Settings.llm = HuggingFaceInferenceAPI(
|
| 64 |
-
model_name="
|
| 65 |
-
tokenizer_name="
|
| 66 |
context_window=3000,
|
| 67 |
token=os.getenv("HF_TOKEN"),
|
| 68 |
max_new_tokens=512,
|
|
@@ -185,7 +185,7 @@ async def chat(request: MessageRequest):
|
|
| 185 |
audio_path = "response.mp3"
|
| 186 |
tts.save(audio_path)
|
| 187 |
return {"response": response1,
|
| 188 |
-
"audioUrl": f"
|
| 189 |
|
| 190 |
@app.get("/")
|
| 191 |
def read_root(request: Request):
|
|
|
|
| 25 |
message: str
|
| 26 |
language: str
|
| 27 |
|
| 28 |
+
repo_id = "HuggingFaceH4/zephyr-7b-alpha"
|
| 29 |
llm_client = InferenceClient(
|
| 30 |
model=repo_id,
|
| 31 |
token=os.getenv("HF_TOKEN"),
|
|
|
|
| 61 |
|
| 62 |
# Configure Llama index settings
|
| 63 |
Settings.llm = HuggingFaceInferenceAPI(
|
| 64 |
+
model_name="HuggingFaceH4/zephyr-7b-alpha",
|
| 65 |
+
tokenizer_name="HuggingFaceH4/zephyr-7b-alpha",
|
| 66 |
context_window=3000,
|
| 67 |
token=os.getenv("HF_TOKEN"),
|
| 68 |
max_new_tokens=512,
|
|
|
|
| 185 |
audio_path = "response.mp3"
|
| 186 |
tts.save(audio_path)
|
| 187 |
return {"response": response1,
|
| 188 |
+
"audioUrl": f"https://redfernstech-hotel-gtts.hf.space/audio/{audio_path}"}
|
| 189 |
|
| 190 |
@app.get("/")
|
| 191 |
def read_root(request: Request):
|