Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -622,11 +622,12 @@ async def llm_generate_text(request):
|
|
622 |
}),
|
623 |
timeout=None)
|
624 |
|
625 |
-
try:
|
626 |
repl = _r.json()['choices'][0]['message']['content']
|
627 |
return PlainTextResponse(repl)
|
628 |
-
|
629 |
-
|
|
|
630 |
|
631 |
async def get_flashcards(request):
|
632 |
# [title, content, keywords]
|
|
|
622 |
}),
|
623 |
timeout=None)
|
624 |
|
625 |
+
try:
|
626 |
repl = _r.json()['choices'][0]['message']['content']
|
627 |
return PlainTextResponse(repl)
|
628 |
+
|
629 |
+
except Exception as e:
|
630 |
+
raise HTTPException(status_code=422, detail=str(e))
|
631 |
|
632 |
async def get_flashcards(request):
|
633 |
# [title, content, keywords]
|