Spaces:
Runtime error
Runtime error
Fix reflex_ui import path for Hugging Face deployment
Browse files
app.py
CHANGED
|
@@ -21,7 +21,11 @@ _reflex_pkg_parent = REPO_ROOT / "reflex_ui"
|
|
| 21 |
if str(_reflex_pkg_parent) not in sys.path:
|
| 22 |
sys.path.insert(0, str(_reflex_pkg_parent))
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
def _predict(code: str, language: str, top_k: float):
|
|
|
|
| 21 |
if str(_reflex_pkg_parent) not in sys.path:
|
| 22 |
sys.path.insert(0, str(_reflex_pkg_parent))
|
| 23 |
|
| 24 |
+
_reflex_pkg_nested = _reflex_pkg_parent / "reflex_ui"
|
| 25 |
+
if str(_reflex_pkg_nested) not in sys.path:
|
| 26 |
+
sys.path.insert(0, str(_reflex_pkg_nested))
|
| 27 |
+
|
| 28 |
+
from backend_bridge import run_prediction # noqa: E402
|
| 29 |
|
| 30 |
|
| 31 |
def _predict(code: str, language: str, top_k: float):
|