poseidon666 commited on
Commit
db7967f
·
verified ·
1 Parent(s): bf7d8e6

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. server/app.py +9 -1
server/app.py CHANGED
@@ -35,10 +35,18 @@ except Exception as e: # pragma: no cover
35
  "openenv is required for the web interface. Install dependencies with '\n uv sync\n'"
36
  ) from e
37
 
 
 
 
 
 
 
 
 
38
  try:
39
  from ..models import QuantumAction, QuantumObservation
40
  from .my_env_environment import QuantumCircuitEnvironment
41
- except ModuleNotFoundError:
42
  from models import QuantumAction, QuantumObservation
43
  from server.my_env_environment import QuantumCircuitEnvironment
44
 
 
35
  "openenv is required for the web interface. Install dependencies with '\n uv sync\n'"
36
  ) from e
37
 
38
+ import os
39
+ import sys
40
+
41
+ _HERE = os.path.dirname(os.path.abspath(__file__))
42
+ _ROOT = os.path.dirname(_HERE)
43
+ if _ROOT not in sys.path:
44
+ sys.path.insert(0, _ROOT)
45
+
46
  try:
47
  from ..models import QuantumAction, QuantumObservation
48
  from .my_env_environment import QuantumCircuitEnvironment
49
+ except ImportError:
50
  from models import QuantumAction, QuantumObservation
51
  from server.my_env_environment import QuantumCircuitEnvironment
52