Arj0010 Claude Sonnet 4.5 commited on
Commit
5656553
·
1 Parent(s): e7cff0c

Fix HuggingFace Spaces compatibility: use Gradio 4.44.0

Browse files

- Revert to Gradio 4.44.0 for HF Spaces compatibility
- Update to Gradio 4.x API (show_download_button instead of buttons)
- Move theme back to Blocks() constructor for Gradio 4.x
- Keep 3D viewer fixes (MutationObserver, proper positioning)

Fixes ImportError with huggingface_hub on HF Spaces.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Files changed (2) hide show
  1. app.py +3 -2
  2. requirements.txt +1 -1
app.py CHANGED
@@ -142,6 +142,7 @@ example_smiles = [
142
 
143
  with gr.Blocks(
144
  title="Drug-Likeness Predictor",
 
145
  head='''
146
  <script src="https://3Dmol.org/build/3Dmol-min.js"></script>
147
  <script>
@@ -212,7 +213,7 @@ with gr.Blocks(
212
  image_output = gr.Image(
213
  label="2D Molecular Structure",
214
  type="pil",
215
- buttons=["download", "fullscreen"],
216
  )
217
 
218
  viewer_html = gr.HTML(label="3D Interactive Viewer")
@@ -235,4 +236,4 @@ with gr.Blocks(
235
  )
236
 
237
  if __name__ == "__main__":
238
- demo.launch(theme=gr.themes.Soft())
 
142
 
143
  with gr.Blocks(
144
  title="Drug-Likeness Predictor",
145
+ theme=gr.themes.Soft(),
146
  head='''
147
  <script src="https://3Dmol.org/build/3Dmol-min.js"></script>
148
  <script>
 
213
  image_output = gr.Image(
214
  label="2D Molecular Structure",
215
  type="pil",
216
+ show_download_button=True,
217
  )
218
 
219
  viewer_html = gr.HTML(label="3D Interactive Viewer")
 
236
  )
237
 
238
  if __name__ == "__main__":
239
+ demo.launch()
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  tensorflow==2.15.0
2
- gradio>=6.0.0
3
  rdkit-pypi>=2022.9.5
4
  joblib>=1.3.2
5
  numpy<2.0.0
 
1
  tensorflow==2.15.0
2
+ gradio==4.44.0
3
  rdkit-pypi>=2022.9.5
4
  joblib>=1.3.2
5
  numpy<2.0.0