BioOps Team commited on
Commit
8aafcf0
·
1 Parent(s): ee168d5

Fix Gradio Model3D loading issue by passing absolute paths to allowed_paths

Browse files
Files changed (2) hide show
  1. app.py +4 -1
  2. bioops/simulation_ui/dashboard.py +2 -2
app.py CHANGED
@@ -32,13 +32,16 @@ def main() -> None:
32
  """Build and launch the BioOps Twin dashboard."""
33
  from bioops.simulation_ui.dashboard import build_dashboard
34
 
 
 
 
35
  logger.info("Launching BioOps Twin dashboard...")
36
  app = build_dashboard()
37
  app.queue().launch(
38
  server_name="0.0.0.0",
39
  server_port=7860,
40
  show_error=True,
41
- allowed_paths=["assets"],
42
  )
43
 
44
 
 
32
  """Build and launch the BioOps Twin dashboard."""
33
  from bioops.simulation_ui.dashboard import build_dashboard
34
 
35
+ import os
36
+ assets_dir = os.path.join(os.path.dirname(__file__), "assets")
37
+
38
  logger.info("Launching BioOps Twin dashboard...")
39
  app = build_dashboard()
40
  app.queue().launch(
41
  server_name="0.0.0.0",
42
  server_port=7860,
43
  show_error=True,
44
+ allowed_paths=[assets_dir],
45
  )
46
 
47
 
bioops/simulation_ui/dashboard.py CHANGED
@@ -181,8 +181,8 @@ def _resolve_model_path() -> str | None:
181
  from pathlib import Path
182
 
183
  candidates = [
184
- Path("assets/centrifuge_rotor.glb"),
185
- Path(__file__).resolve().parents[2] / "assets" / "centrifuge_rotor.glb",
186
  ]
187
  for p in candidates:
188
  if p.exists():
 
181
  from pathlib import Path
182
 
183
  candidates = [
184
+ Path("assets/centrifuge_rotor.glb").resolve(),
185
+ (Path(__file__).resolve().parents[2] / "assets" / "centrifuge_rotor.glb").resolve(),
186
  ]
187
  for p in candidates:
188
  if p.exists():