Riy777 commited on
Commit
41aa41f
·
verified ·
1 Parent(s): 26c084f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -13,10 +13,8 @@ history = []
13
 
14
  def chat_with_model(message, files=None):
15
  global history
16
-
17
  content = message
18
 
19
- # قراءة محتوى الملفات المرفوعة
20
  if files:
21
  for file in files:
22
  try:
@@ -46,15 +44,16 @@ def chat_with_model(message, files=None):
46
 
47
  return response_text, history
48
 
49
- # واجهة Gradio
50
  with gr.Blocks() as demo:
51
  gr.Markdown("# NVIDIA Qwen3 Chat (متعدد الملفات)")
52
- chatbot = gr.Chatbot(type="messages") # تصحيح التحذير
53
 
54
  msg = gr.Textbox(label="اكتب رسالتك هنا")
 
55
  files_input = gr.File(label="ارفع ملفات Python أو نصية",
56
  file_types=[".py", ".txt"],
57
- file_types_multiple=True) # الاستخدام الصحيح للنسخ الحديثة
 
58
  send = gr.Button("إرسال")
59
 
60
  def handle_submit(message, files):
 
13
 
14
  def chat_with_model(message, files=None):
15
  global history
 
16
  content = message
17
 
 
18
  if files:
19
  for file in files:
20
  try:
 
44
 
45
  return response_text, history
46
 
 
47
  with gr.Blocks() as demo:
48
  gr.Markdown("# NVIDIA Qwen3 Chat (متعدد الملفات)")
49
+ chatbot = gr.Chatbot(type="messages")
50
 
51
  msg = gr.Textbox(label="اكتب رسالتك هنا")
52
+ # الاستخدام الصحيح لقبول ملفات متعددة
53
  files_input = gr.File(label="ارفع ملفات Python أو نصية",
54
  file_types=[".py", ".txt"],
55
+ file_types=None,
56
+ file_types_allow_multiple=True) # هذه تعمل غالباً على النسخ القديمة
57
  send = gr.Button("إرسال")
58
 
59
  def handle_submit(message, files):