Spaces:
Sleeping
Sleeping
Commit
·
1e19152
1
Parent(s):
9e101ef
Fix: add src to Python path for HF Spaces
Browse files- app.py +7 -0
- requirements.txt +0 -3
app.py
CHANGED
|
@@ -5,6 +5,13 @@ It's configured to work without GPU (embeddings on CPU, LLM via Groq).
|
|
| 5 |
"""
|
| 6 |
|
| 7 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Configure for HF Spaces environment
|
| 10 |
os.environ.setdefault("MODEL_LLM_PROVIDER", "groq")
|
|
|
|
| 5 |
"""
|
| 6 |
|
| 7 |
import os
|
| 8 |
+
import sys
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
# Add src to path for HF Spaces (no pip install -e . available)
|
| 12 |
+
src_path = Path(__file__).parent / "src"
|
| 13 |
+
if src_path.exists():
|
| 14 |
+
sys.path.insert(0, str(src_path))
|
| 15 |
|
| 16 |
# Configure for HF Spaces environment
|
| 17 |
os.environ.setdefault("MODEL_LLM_PROVIDER", "groq")
|
requirements.txt
CHANGED
|
@@ -19,6 +19,3 @@ openai>=1.50.0
|
|
| 19 |
|
| 20 |
# Note: torch is pre-installed on HF Spaces
|
| 21 |
# Note: accelerate and bitsandbytes not needed for CPU-only inference
|
| 22 |
-
|
| 23 |
-
# Install the coderag package from local source
|
| 24 |
-
-e .
|
|
|
|
| 19 |
|
| 20 |
# Note: torch is pre-installed on HF Spaces
|
| 21 |
# Note: accelerate and bitsandbytes not needed for CPU-only inference
|
|
|
|
|
|
|
|
|