M17idd commited on
Commit
a6c1dbc
·
verified ·
1 Parent(s): a951f7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -52,13 +52,10 @@ if query:
52
  response = llm([{"role": "system", "content": "You are a helpful assistant."},
53
  {"role": "user", "content": prompt}])
54
 
55
- # استخراج پاسخ مدل
56
- if isinstance(response, dict) and 'choices' in response:
57
- rewritten = response['choices'][0]['message']['content'].strip()
58
- st.markdown("🎨 **بازنویسی شده با LLM:**")
59
- st.write(rewritten)
60
- else:
61
- st.warning("پاسخ دریافتی معتبر نیست.")
62
 
63
  found = True
64
  break
 
52
  response = llm([{"role": "system", "content": "You are a helpful assistant."},
53
  {"role": "user", "content": prompt}])
54
 
55
+ rewritten = response.strip()
56
+ st.markdown("🎨 **بازنویسی شده با LLM:**")
57
+ st.write(rewritten)
58
+ st.warning("پاسخ دریافتی معتبر نیست.")
 
 
 
59
 
60
  found = True
61
  break