Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,16 +3,29 @@ import os
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
# ---------------------------------------------------
|
| 6 |
-
# 🔧 Patch:
|
| 7 |
# ---------------------------------------------------
|
| 8 |
_old_blocks = gr.Blocks
|
| 9 |
|
| 10 |
def PatchedBlocks(*args, **kwargs):
|
| 11 |
-
kwargs.pop("theme", None)
|
| 12 |
-
kwargs.pop("fill_height", None)
|
| 13 |
return _old_blocks(*args, **kwargs)
|
| 14 |
|
| 15 |
gr.Blocks = PatchedBlocks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# ---------------------------------------------------
|
| 17 |
|
| 18 |
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
# ---------------------------------------------------
|
| 6 |
+
# 🔧 Patch 1: Blocks ignores old kwargs
|
| 7 |
# ---------------------------------------------------
|
| 8 |
_old_blocks = gr.Blocks
|
| 9 |
|
| 10 |
def PatchedBlocks(*args, **kwargs):
|
| 11 |
+
kwargs.pop("theme", None)
|
| 12 |
+
kwargs.pop("fill_height", None)
|
| 13 |
return _old_blocks(*args, **kwargs)
|
| 14 |
|
| 15 |
gr.Blocks = PatchedBlocks
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
# ---------------------------------------------------
|
| 19 |
+
# 🔧 Patch 2: Chatbot ignores deprecated kwargs
|
| 20 |
+
# ---------------------------------------------------
|
| 21 |
+
_old_chatbot = gr.Chatbot
|
| 22 |
+
|
| 23 |
+
def PatchedChatbot(*args, **kwargs):
|
| 24 |
+
kwargs.pop("type", None) # removed in Gradio 6
|
| 25 |
+
kwargs.pop("like", None) # sometimes causes issues too
|
| 26 |
+
return _old_chatbot(*args, **kwargs)
|
| 27 |
+
|
| 28 |
+
gr.Chatbot = PatchedChatbot
|
| 29 |
# ---------------------------------------------------
|
| 30 |
|
| 31 |
|