Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -21
src/streamlit_app.py
CHANGED
|
@@ -15,27 +15,11 @@ st.markdown("This end-to-end LLM Agent classifies your IT issue, retrieves the r
|
|
| 15 |
# --- 1. Load Models (Cached so they only load once) ---
|
| 16 |
@st.cache_resource
|
| 17 |
def load_pipeline():
|
| 18 |
-
# 1. Load DistilBERT Classifier
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
if 'model.safetensors' in files:
|
| 24 |
-
actual_path = root
|
| 25 |
-
break
|
| 26 |
-
import os
|
| 27 |
-
|
| 28 |
-
# 1. Get the directory of the current script (the /src folder)
|
| 29 |
-
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 30 |
-
|
| 31 |
-
# 2. Go up one level to the root, then into the model folder
|
| 32 |
-
actual_path = os.path.join(current_dir, "..", "autoresolve_distilbert_final")
|
| 33 |
-
|
| 34 |
-
# 3. Load the model using this strict absolute path
|
| 35 |
-
distil_tokenizer = DistilBertTokenizerFast.from_pretrained(actual_path)
|
| 36 |
-
distil_model = DistilBertForSequenceClassification.from_pretrained(actual_path)
|
| 37 |
-
|
| 38 |
-
|
| 39 |
|
| 40 |
# 2. Knowledge Base & Retriever
|
| 41 |
kb = [
|
|
|
|
| 15 |
# --- 1. Load Models (Cached so they only load once) ---
|
| 16 |
@st.cache_resource
|
| 17 |
def load_pipeline():
|
| 18 |
+
# 1. Load DistilBERT Classifier from your HF Model Repo
|
| 19 |
+
repo_id = "Shauryaaa05/AutoResolve-DistilBERT"
|
| 20 |
+
|
| 21 |
+
distil_tokenizer = DistilBertTokenizerFast.from_pretrained(repo_id)
|
| 22 |
+
distil_model = DistilBertForSequenceClassification.from_pretrained(repo_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# 2. Knowledge Base & Retriever
|
| 25 |
kb = [
|