Spaces:
Running
Running
Charlie Li commited on
Commit ·
49eaeb8
1
Parent(s): 4440a50
change gradio version
Browse files- README.md +1 -1
- app.py +12 -6
- requirements.txt +1 -1
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: "\U0001F4C4"
|
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: true
|
| 10 |
models:
|
|
|
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 6.11.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: true
|
| 10 |
models:
|
app.py
CHANGED
|
@@ -19,6 +19,7 @@ from config import (
|
|
| 19 |
)
|
| 20 |
|
| 21 |
STATIC_DIRS = [str(BASE_DIR / "videos"), str(BASE_DIR / "assets")]
|
|
|
|
| 22 |
gr.set_static_paths(paths=STATIC_DIRS)
|
| 23 |
|
| 24 |
with open(BASE_DIR / "style.css", encoding="utf-8") as css_file:
|
|
@@ -296,7 +297,12 @@ def build_model_card_head(model_key: str) -> str:
|
|
| 296 |
"""
|
| 297 |
|
| 298 |
|
| 299 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 300 |
gr.HTML(build_hero_html())
|
| 301 |
gr.HTML(build_explorer_intro_html())
|
| 302 |
|
|
@@ -379,8 +385,8 @@ with gr.Blocks(title="MuscleMimic Research Space") as app:
|
|
| 379 |
)
|
| 380 |
|
| 381 |
if __name__ == "__main__":
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
css=CUSTOM_CSS
|
| 385 |
-
js=build_autoplay_js()
|
| 386 |
-
)
|
|
|
|
| 19 |
)
|
| 20 |
|
| 21 |
STATIC_DIRS = [str(BASE_DIR / "videos"), str(BASE_DIR / "assets")]
|
| 22 |
+
GRADIO_MAJOR = int(gr.__version__.split(".", 1)[0])
|
| 23 |
gr.set_static_paths(paths=STATIC_DIRS)
|
| 24 |
|
| 25 |
with open(BASE_DIR / "style.css", encoding="utf-8") as css_file:
|
|
|
|
| 297 |
"""
|
| 298 |
|
| 299 |
|
| 300 |
+
blocks_kwargs = {"title": "MuscleMimic Research Space"}
|
| 301 |
+
if GRADIO_MAJOR < 6:
|
| 302 |
+
blocks_kwargs["css"] = CUSTOM_CSS
|
| 303 |
+
blocks_kwargs["js"] = build_autoplay_js()
|
| 304 |
+
|
| 305 |
+
with gr.Blocks(**blocks_kwargs) as app:
|
| 306 |
gr.HTML(build_hero_html())
|
| 307 |
gr.HTML(build_explorer_intro_html())
|
| 308 |
|
|
|
|
| 385 |
)
|
| 386 |
|
| 387 |
if __name__ == "__main__":
|
| 388 |
+
launch_kwargs = {"allowed_paths": STATIC_DIRS}
|
| 389 |
+
if GRADIO_MAJOR >= 6:
|
| 390 |
+
launch_kwargs["css"] = CUSTOM_CSS
|
| 391 |
+
launch_kwargs["js"] = build_autoplay_js()
|
| 392 |
+
app.launch(**launch_kwargs)
|
requirements.txt
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
gradio>=
|
|
|
|
| 1 |
+
gradio>=6.11.0,<7.0.0
|