Update endpoints.py
Browse files- endpoints.py +4 -4
endpoints.py
CHANGED
|
@@ -37,11 +37,11 @@ def get():
|
|
| 37 |
return {"message": result}
|
| 38 |
|
| 39 |
|
| 40 |
-
def askLLM(prompt):
|
| 41 |
-
output = pipe(prompt,do_sample=False)
|
| 42 |
return output
|
| 43 |
|
| 44 |
@app.post("/ask_llm")
|
| 45 |
-
def ask_llm_endpoint(prompt: str):
|
| 46 |
-
result = askLLM(prompt)
|
| 47 |
return {"result": result}
|
|
|
|
| 37 |
return {"message": result}
|
| 38 |
|
| 39 |
|
| 40 |
+
async def askLLM(prompt):
|
| 41 |
+
output = await pipe(prompt,do_sample=False)
|
| 42 |
return output
|
| 43 |
|
| 44 |
@app.post("/ask_llm")
|
| 45 |
+
async def ask_llm_endpoint(prompt: str):
|
| 46 |
+
result = await askLLM(prompt)
|
| 47 |
return {"result": result}
|