yasserrmd commited on
Commit
3e726ee
ยท
verified ยท
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()