jesbu1 commited on
Commit
181f3ff
·
1 Parent(s): 5aeaf5e

gradio installation is moved and a fallback is added

Browse files
Files changed (2) hide show
  1. app.py +8 -1
  2. requirements.txt +2 -1
app.py CHANGED
@@ -668,7 +668,14 @@ def create_comparison_plot(frames_a: list, frames_b: list, prediction_type: str)
668
 
669
 
670
  # Create Gradio interface
671
- with gr.Blocks(title="RFM Inference Visualizer", theme=gr.themes.Soft()) as demo:
 
 
 
 
 
 
 
672
  gr.Markdown(
673
  """
674
  # 🤖 RFM (Reward Foundation Model) Inference Visualizer
 
668
 
669
 
670
  # Create Gradio interface
671
+ try:
672
+ # Try with theme (Gradio 4.0+)
673
+ demo = gr.Blocks(title="RFM Inference Visualizer", theme=gr.themes.Soft())
674
+ except TypeError:
675
+ # Fallback for older Gradio versions without theme support
676
+ demo = gr.Blocks(title="RFM Inference Visualizer")
677
+
678
+ with demo:
679
  gr.Markdown(
680
  """
681
  # 🤖 RFM (Reward Foundation Model) Inference Visualizer
requirements.txt CHANGED
@@ -1,7 +1,6 @@
1
  # Requirements for RFM Eval UI Gradio App
2
 
3
  # Core dependencies
4
- gradio>=4.19.0
5
  matplotlib>=3.5.0
6
  numpy>=1.21.0
7
  torch>=2.0.0
@@ -29,3 +28,5 @@ watchfiles # For file watching during development
29
  # For local development, you can also install with: pip install -e ../ (from parent directory)
30
  git+https://github.com/aliang8/reward_fm.git@93b1ad4b5a530fb32c234bf926b659105e676d00
31
 
 
 
 
1
  # Requirements for RFM Eval UI Gradio App
2
 
3
  # Core dependencies
 
4
  matplotlib>=3.5.0
5
  numpy>=1.21.0
6
  torch>=2.0.0
 
28
  # For local development, you can also install with: pip install -e ../ (from parent directory)
29
  git+https://github.com/aliang8/reward_fm.git@93b1ad4b5a530fb32c234bf926b659105e676d00
30
 
31
+ # Make sure a newer version of gradio is installed
32
+ gradio==4.44.0