tlong-ds commited on
Commit
a594fb9
·
verified ·
1 Parent(s): f31ff01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -23,10 +23,10 @@ async def chat_endpoint(message: str = Form(...)):
23
  llm_model_cache["llm"] = get_llm()
24
 
25
  prediction = classification_modeL_cache["model"].predict(message)
26
- sentiment = "Positive" if prediction[0][1] > 0.5 else "Negative"
27
 
28
  result = llm_model_cache["llm"].invoke(
29
- prompt.format(text=message, prediction=sentiment))
30
 
31
  if result:
32
  return result.content
 
23
  llm_model_cache["llm"] = get_llm()
24
 
25
  prediction = classification_modeL_cache["model"].predict(message)
26
+
27
 
28
  result = llm_model_cache["llm"].invoke(
29
+ prompt.format(text=message, positive_prob=prediction[0][1], negative_prob=prediction[0][0]))
30
 
31
  if result:
32
  return result.content