XiaoBai1221 commited on
Commit
f2900ce
·
1 Parent(s): 3a86301

Fix Gradio launch parameters: remove incompatible enable_queue

Browse files

- Remove enable_queue parameter causing TypeError
- Simplify launch parameters to basic stable options
- Fix Gradio 4.44.x compatibility issues
- Use gr.Interface consistently for better stability
- Model loading working correctly on server

Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -74,7 +74,7 @@ def clear_sequence():
74
  else:
75
  return "⚠️ 模型未載入"
76
 
77
- # 使用最簡單的Gradio介面來避免schema問題
78
  title = "🤟 SignView2.0 - 手語辨識系統"
79
  description = """
80
  **支援34種手語詞彙的即時辨識系統,準確率達94.25%**
@@ -84,9 +84,11 @@ description = """
84
  🚀 **使用說明**: 上傳影像 → 點擊分析 → 查看結果
85
 
86
  📊 **系統資訊**: 準確率94.25% | F1分數94.24% | MediaPipe + 光流特徵 | BiLSTM + 注意力機制
 
 
87
  """
88
 
89
- # 使用Interface而不是Blocks來避免複雜的schema問題
90
  demo = gr.Interface(
91
  fn=process_image,
92
  inputs=gr.Image(label="上傳手語影像"),
@@ -96,19 +98,16 @@ demo = gr.Interface(
96
  ],
97
  title=title,
98
  description=description,
99
- examples=None,
100
- cache_examples=False,
101
  allow_flagging="never"
102
  )
103
 
104
  if __name__ == "__main__":
105
  print("🎉 SignView2.0 手語辨識系統已啟動!")
106
 
107
- # 使用最安全的launch參數
108
  demo.launch(
109
  share=True,
110
  server_name="0.0.0.0",
111
  server_port=7860,
112
- enable_queue=False,
113
  show_error=True
114
  )
 
74
  else:
75
  return "⚠️ 模型未載入"
76
 
77
+ # 使用最簡單且穩定的Gradio介面
78
  title = "🤟 SignView2.0 - 手語辨識系統"
79
  description = """
80
  **支援34種手語詞彙的即時辨識系統,準確率達94.25%**
 
84
  🚀 **使用說明**: 上傳影像 → 點擊分析 → 查看結果
85
 
86
  📊 **系統資訊**: 準確率94.25% | F1分數94.24% | MediaPipe + 光流特徵 | BiLSTM + 注意力機制
87
+
88
+ **開發者**: XiaoBai1221 | **平台**: Hugging Face Spaces
89
  """
90
 
91
+ # 使用Interface來避免Blocks的複雜問題
92
  demo = gr.Interface(
93
  fn=process_image,
94
  inputs=gr.Image(label="上傳手語影像"),
 
98
  ],
99
  title=title,
100
  description=description,
 
 
101
  allow_flagging="never"
102
  )
103
 
104
  if __name__ == "__main__":
105
  print("🎉 SignView2.0 手語辨識系統已啟動!")
106
 
107
+ # 使用最簡化的launch參數,移除可能有問題的參數
108
  demo.launch(
109
  share=True,
110
  server_name="0.0.0.0",
111
  server_port=7860,
 
112
  show_error=True
113
  )