ykl910 commited on
Commit
e7f232c
·
verified ·
1 Parent(s): 0d112e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -44,6 +44,16 @@ agent = CodeAgent(
44
  prompt_templates=prompt_templates
45
  )
46
  if __name__ == "__main__":
47
- import gradio
48
- print("GRADIO VERSION:", gradio.__version__)
 
 
 
 
 
 
 
 
 
 
49
  GradioUI(agent).launch()
 
44
  prompt_templates=prompt_templates
45
  )
46
  if __name__ == "__main__":
47
+ import gradio as gr
48
+ from smolagents import GradioUI
49
+
50
+ # Monkey-patch Blocks to ignore unknown kwargs
51
+ _old_blocks = gr.Blocks
52
+
53
+ def PatchedBlocks(*args, **kwargs):
54
+ kwargs.pop("theme", None)
55
+ return _old_blocks(*args, **kwargs)
56
+
57
+ gr.Blocks = PatchedBlocks
58
+
59
  GradioUI(agent).launch()