Nitzantry1 commited on
Commit
d1de333
ยท
verified ยท
1 Parent(s): 7b56d83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -12,10 +12,14 @@ def chat_with_model(history):
12
  )
13
  return history + [{"role": "user", "content": prompt}, {"role": "bot", "content": result}]
14
 
15
- # ื™ืฆื™ืจืช ืžืžืฉืง ืžืชืงื“ื ืขื Gradio ื‘ืฆื•ืจืช ืฆ'ื˜-ื‘ื•ื˜ ืขื ืœื•ื’ื• ืฉืœ DICTA
16
  with gr.Blocks(theme="default") as demo:
17
- gr.Image(value="dicta-logo.jpg", elem_id="logo", width=200, height=100)
18
- gr.Markdown("# ืฆ'ืื˜ ืขื ืžื•ื“ืœ DictaLM", elem_id="title")
 
 
 
 
19
  chatbot = gr.Chatbot(label="ืฆ'ืื˜ ืขื ืžื•ื“ืœ DictaLM", type="messages")
20
  with gr.Row():
21
  user_input = gr.Textbox(placeholder="ื”ื›ื ืก ืืช ื”ื”ื•ื“ืขื” ืฉืœืš ื›ืืŸ...", label="", lines=1)
@@ -24,6 +28,7 @@ with gr.Blocks(theme="default") as demo:
24
  def user_chat(history, message):
25
  return history + [{"role": "user", "content": message}], ""
26
 
 
27
  user_input.submit(user_chat, inputs=[chatbot, user_input], outputs=[chatbot, user_input], queue=False)
28
  user_input.submit(chat_with_model, inputs=chatbot, outputs=chatbot)
29
  send_button.click(user_chat, inputs=[chatbot, user_input], outputs=[chatbot, user_input], queue=False)
 
12
  )
13
  return history + [{"role": "user", "content": prompt}, {"role": "bot", "content": result}]
14
 
15
+ # ื™ืฆื™ืจืช ืžืžืฉืง ืžืชืงื“ื ืขื Gradio ื‘ืฆื•ืจืช ืฆ'ื˜-ื‘ื•ื˜ ื‘ืกื’ื ื•ืŸ ืืงื“ืžื™
16
  with gr.Blocks(theme="default") as demo:
17
+ gr.HTML("""
18
+ <div style="background-color: #f5f5f5; padding: 20px; text-align: center;">
19
+ <h1 style="color: #003366; font-family: 'Trebuchet MS', sans-serif;">ืฆ'ืื˜ ืขื ืžื•ื“ืœ DictaLM</h1>
20
+ <p style="font-family: 'Trebuchet MS', sans-serif; color: #333;">ื‘ืจื•ื›ื™ื ื”ื‘ืื™ื ืœืฆ'ืื˜ ื”ืื™ื ื˜ืจืืงื˜ื™ื‘ื™ ืฉืœื ื•, ื”ืžืืคืฉืจ ืœื›ื ืœื”ืชื ืกื•ืช ื‘ืฉื™ื—ื” ืขื ืžื•ื“ืœ AI ืžืชืงื“ื.</p>
21
+ </div>
22
+ """)
23
  chatbot = gr.Chatbot(label="ืฆ'ืื˜ ืขื ืžื•ื“ืœ DictaLM", type="messages")
24
  with gr.Row():
25
  user_input = gr.Textbox(placeholder="ื”ื›ื ืก ืืช ื”ื”ื•ื“ืขื” ืฉืœืš ื›ืืŸ...", label="", lines=1)
 
28
  def user_chat(history, message):
29
  return history + [{"role": "user", "content": message}], ""
30
 
31
+ # ืชืžื™ื›ื” ื‘ืœื—ื™ืฆื” ืขืœ Enter ื‘ื ื•ืกืฃ ืœืœื—ืฆืŸ "ืฉืœื—"
32
  user_input.submit(user_chat, inputs=[chatbot, user_input], outputs=[chatbot, user_input], queue=False)
33
  user_input.submit(chat_with_model, inputs=chatbot, outputs=chatbot)
34
  send_button.click(user_chat, inputs=[chatbot, user_input], outputs=[chatbot, user_input], queue=False)