yasserrmd commited on
Commit
3e726ee
1 Parent(s): 6de18d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -4
app.py CHANGED
@@ -22,11 +22,11 @@ def chat(input_text, history=[]):
22
 
23
  # Update the conversation history
24
  history.append((input_text, response))
25
- return history, history
26
 
27
 
28
  with gr.Blocks() as app:
29
- gr.Markdown("<h1 style='text-align: center;'>دردشة أطلس-شات 27B</h1>")
30
  chatbot = gr.Chatbot(label="المحادثة")
31
  state = gr.State([])
32
 
@@ -35,7 +35,20 @@ with gr.Blocks() as app:
35
  send_button = gr.Button("إرسال")
36
 
37
  # Link the chat function to both text submission and button click
38
- txt.submit(chat, [txt, state], [chatbot, state])
39
- send_button.click(chat, [txt, state], [chatbot, state])
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  app.launch()
 
22
 
23
  # Update the conversation history
24
  history.append((input_text, response))
25
+ return history, history,""
26
 
27
 
28
  with gr.Blocks() as app:
29
+ gr.Markdown("<h1 style='text-align: center;'>دردشة أطلس</h1>")
30
  chatbot = gr.Chatbot(label="المحادثة")
31
  state = gr.State([])
32
 
 
35
  send_button = gr.Button("إرسال")
36
 
37
  # Link the chat function to both text submission and button click
38
+ txt.submit(chat, [txt, state], [chatbot, state,txt])
39
+ send_button.click(chat, [txt, state], [chatbot, state,txt])
40
+
41
+ examples = [
42
+ ["مرحباً! كيف يمكنني مساعدتك اليوم؟"],
43
+ ["ما هي أحدث أخبار الذكاء الاصطناعي؟"],
44
+ ["كيف يمكنني البدء في تعلم البرمجة؟"]
45
+ ]
46
+
47
+ gr.Examples(
48
+ examples=examples,
49
+ inputs=txt,
50
+ label="أمثلة على الأسئلة",
51
+ description="اختر من الأمثلة أدناه للبدء."
52
+ )
53
 
54
  app.launch()