Neon-AI commited on
Commit
dc23d91
·
verified ·
1 Parent(s): d0c5b7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -102,9 +102,9 @@ def generate(req: PromptRequest):
102
  if "choices" in chunk:
103
  output_text += chunk["choices"][0]["text"]
104
 
105
- logger.info(f"Prompt processed successfully: {req.prompt[:50]}...")
106
  return {"response": output_text}
107
 
108
  except Exception as e:
109
- logger.exception("Error during generation")
110
- raise HTTPException(status_code=500, detail=f"Generation error: {str(e)}")
 
 
102
  if "choices" in chunk:
103
  output_text += chunk["choices"][0]["text"]
104
 
 
105
  return {"response": output_text}
106
 
107
  except Exception as e:
108
+ # Instead of raising 500, return JSON with error
109
+ print(" Error during generation:", e)
110
+ return {"error": str(e)}