Spaces:
Sleeping
Sleeping
Quincy Hsieh commited on
Commit ·
312a42b
1
Parent(s): 035ac6d
Increase embedding/LLM call timeout
Browse files
app.py
CHANGED
|
@@ -181,7 +181,7 @@ def generate_embeddings(texts: list[str]) -> list[list[float]]:
|
|
| 181 |
}
|
| 182 |
try:
|
| 183 |
resp = http_requests.post(
|
| 184 |
-
EMBEDDING_ENDPOINT_URL, headers=headers, json=payload, timeout=
|
| 185 |
)
|
| 186 |
resp.raise_for_status()
|
| 187 |
data = resp.json()
|
|
@@ -278,7 +278,7 @@ def call_llm(prompt: str) -> dict:
|
|
| 278 |
"top_p": LLM_TOP_P,
|
| 279 |
}
|
| 280 |
try:
|
| 281 |
-
resp = http_requests.post(LLM_ENDPOINT_URL, headers=headers, json=payload, timeout=
|
| 282 |
resp.raise_for_status()
|
| 283 |
data = resp.json()
|
| 284 |
content = data["choices"][0]["message"]["content"].strip()
|
|
|
|
| 181 |
}
|
| 182 |
try:
|
| 183 |
resp = http_requests.post(
|
| 184 |
+
EMBEDDING_ENDPOINT_URL, headers=headers, json=payload, timeout=120,
|
| 185 |
)
|
| 186 |
resp.raise_for_status()
|
| 187 |
data = resp.json()
|
|
|
|
| 278 |
"top_p": LLM_TOP_P,
|
| 279 |
}
|
| 280 |
try:
|
| 281 |
+
resp = http_requests.post(LLM_ENDPOINT_URL, headers=headers, json=payload, timeout=None)
|
| 282 |
resp.raise_for_status()
|
| 283 |
data = resp.json()
|
| 284 |
content = data["choices"][0]["message"]["content"].strip()
|