coredipper commited on
Commit
2de38fa
·
verified ·
1 Parent(s): 1ebd476

fix: guard parents[2] for HF runtime

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -14,9 +14,12 @@ from pathlib import Path
14
 
15
  import gradio as gr
16
 
17
- _repo_root = Path(__file__).resolve().parents[2]
18
- if str(_repo_root) not in sys.path:
19
- sys.path.insert(0, str(_repo_root))
 
 
 
20
 
21
  from operon_ai import ATP_Store, MockProvider, Nucleus, SkillStage, skill_organism
22
  from operon_ai.convergence.langgraph_compiler import (
 
14
 
15
  import gradio as gr
16
 
17
+ try:
18
+ _repo_root = Path(__file__).resolve().parents[2]
19
+ if str(_repo_root) not in sys.path:
20
+ sys.path.insert(0, str(_repo_root))
21
+ except IndexError:
22
+ pass # Running on HF — operon-ai installed via requirements.txt
23
 
24
  from operon_ai import ATP_Store, MockProvider, Nucleus, SkillStage, skill_organism
25
  from operon_ai.convergence.langgraph_compiler import (