Spaces:
Runtime error
Runtime error
Fix async blocking
Browse files
app.py
CHANGED
|
@@ -31,8 +31,10 @@ async def chat_completions(request: Request):
|
|
| 31 |
elif m["role"] == "assistant":
|
| 32 |
prompt += f"{m['content']}</s> "
|
| 33 |
|
|
|
|
| 34 |
try:
|
| 35 |
-
response =
|
|
|
|
| 36 |
prompt=prompt,
|
| 37 |
max_tokens=max_tokens,
|
| 38 |
temperature=temperature,
|
|
|
|
| 31 |
elif m["role"] == "assistant":
|
| 32 |
prompt += f"{m['content']}</s> "
|
| 33 |
|
| 34 |
+
import asyncio
|
| 35 |
try:
|
| 36 |
+
response = await asyncio.to_thread(
|
| 37 |
+
llm,
|
| 38 |
prompt=prompt,
|
| 39 |
max_tokens=max_tokens,
|
| 40 |
temperature=temperature,
|