Fix Hugging Face entrypoint and import path
Browse files- README.md +2 -1
- apps/streamlit_app.py +7 -2
README.md
CHANGED
|
@@ -5,10 +5,11 @@ colorFrom: blue
|
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: streamlit
|
| 7 |
sdk_version: "1.51.0"
|
| 8 |
-
app_file:
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
|
|
|
| 12 |
# π AskMyDoc
|
| 13 |
A Retrieval-Augmented Generation (RAG) powered document Q&A app built with **LangChain** and **Streamlit**.
|
| 14 |
Upload your `.pdf`, `.txt`, or `.md` files and ask questions β get accurate, context-aware answers instantly.
|
|
|
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: streamlit
|
| 7 |
sdk_version: "1.51.0"
|
| 8 |
+
app_file: apps/streamlit_app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
|
| 13 |
# π AskMyDoc
|
| 14 |
A Retrieval-Augmented Generation (RAG) powered document Q&A app built with **LangChain** and **Streamlit**.
|
| 15 |
Upload your `.pdf`, `.txt`, or `.md` files and ask questions β get accurate, context-aware answers instantly.
|
apps/streamlit_app.py
CHANGED
|
@@ -1,9 +1,14 @@
|
|
| 1 |
# app/app.py
|
| 2 |
import sys, os
|
| 3 |
-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
from pathlib import Path
|
|
|
|
| 7 |
from apps.rag_pipeline import rag_pipeline
|
| 8 |
from apps.core.config import UPLOAD_DIR, APP_NAME, DESCRIPTION
|
| 9 |
|
|
|
|
| 1 |
# app/app.py
|
| 2 |
import sys, os
|
|
|
|
| 3 |
|
| 4 |
+
# Ensure root and submodules are importable
|
| 5 |
+
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 6 |
+
ROOT_DIR = os.path.abspath(os.path.join(CURRENT_DIR, ".."))
|
| 7 |
+
if ROOT_DIR not in sys.path:
|
| 8 |
+
sys.path.insert(0, ROOT_DIR)
|
| 9 |
+
|
| 10 |
from pathlib import Path
|
| 11 |
+
import streamlit as st
|
| 12 |
from apps.rag_pipeline import rag_pipeline
|
| 13 |
from apps.core.config import UPLOAD_DIR, APP_NAME, DESCRIPTION
|
| 14 |
|