Opera8 commited on
Commit
032367f
·
verified ·
1 Parent(s): b6424a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -25,7 +25,6 @@ def respond(message, history):
25
  # بررسی وجود تصویر در پیام
26
  image_path = None
27
  if files:
28
- # انتخاب اولین فایل آپلود شده
29
  image_path = files[0]["path"] if isinstance(files[0], dict) else files[0]
30
 
31
  img_b64 = convert_to_b64(image_path) if image_path else None
@@ -67,8 +66,8 @@ def respond(message, history):
67
  except Exception as e:
68
  yield f"❌ خطای غیرمنتظره: {e}"
69
 
70
- # اعمال تم به صورت استاندارد با استفاده از gr.Blocks
71
- with gr.Blocks(theme="soft") as demo:
72
  gr.ChatInterface(
73
  fn=respond,
74
  title="Alpha AI Test Space 🤖",
@@ -84,5 +83,6 @@ with gr.Blocks(theme="soft") as demo:
84
  ]
85
  )
86
 
 
87
  if __name__ == "__main__":
88
- demo.launch()
 
25
  # بررسی وجود تصویر در پیام
26
  image_path = None
27
  if files:
 
28
  image_path = files[0]["path"] if isinstance(files[0], dict) else files[0]
29
 
30
  img_b64 = convert_to_b64(image_path) if image_path else None
 
66
  except Exception as e:
67
  yield f"❌ خطای غیرمنتظره: {e}"
68
 
69
+ # در Gradio 6 پارامتر theme از ساختار Blocks حذف شده است
70
+ with gr.Blocks() as demo:
71
  gr.ChatInterface(
72
  fn=respond,
73
  title="Alpha AI Test Space 🤖",
 
83
  ]
84
  )
85
 
86
+ # تم به متد launch منتقل شد تا هشداری نمایش داده نشود
87
  if __name__ == "__main__":
88
+ demo.launch(theme="soft")