Spaces:
Running
Running
unknown commited on
Commit ·
3cb8345
1
Parent(s): 71276a4
Fix HF Space src import path
Browse files
app.py
CHANGED
|
@@ -1,10 +1,18 @@
|
|
| 1 |
import json
|
| 2 |
import tempfile
|
| 3 |
import html
|
|
|
|
| 4 |
from pathlib import Path
|
| 5 |
-
|
| 6 |
import gradio as gr
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
try:
|
| 9 |
from paper2lab.inference.pipeline import PaperPipeline
|
| 10 |
except Exception:
|
|
|
|
| 1 |
import json
|
| 2 |
import tempfile
|
| 3 |
import html
|
| 4 |
+
import sys
|
| 5 |
from pathlib import Path
|
|
|
|
| 6 |
import gradio as gr
|
| 7 |
|
| 8 |
+
|
| 9 |
+
ROOT_DIR = Path(__file__).resolve().parent
|
| 10 |
+
SRC_DIR = ROOT_DIR / "src"
|
| 11 |
+
|
| 12 |
+
if SRC_DIR.exists() and str(SRC_DIR) not in sys.path:
|
| 13 |
+
sys.path.insert(0, str(SRC_DIR))
|
| 14 |
+
|
| 15 |
+
|
| 16 |
try:
|
| 17 |
from paper2lab.inference.pipeline import PaperPipeline
|
| 18 |
except Exception:
|