Shauryaaa05 commited on
Commit
819a0d6
·
verified ·
1 Parent(s): 5bfbd1d

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +9 -2
src/streamlit_app.py CHANGED
@@ -17,8 +17,15 @@ st.markdown("This end-to-end LLM Agent classifies your IT issue, retrieves the r
17
  def load_pipeline():
18
  # 1. Load DistilBERT Classifier
19
  # Note: You must upload your 'autoresolve_distilbert_final' folder to the HF space!
20
- distil_tokenizer = DistilBertTokenizerFast.from_pretrained("../autoresolve_distilbert_final")
21
- distil_model = DistilBertForSequenceClassification.from_pretrained("../autoresolve_distilbert_final")
 
 
 
 
 
 
 
22
 
23
  # 2. Knowledge Base & Retriever
24
  kb = [
 
17
  def load_pipeline():
18
  # 1. Load DistilBERT Classifier
19
  # Note: You must upload your 'autoresolve_distilbert_final' folder to the HF space!
20
+ import os
21
+ actual_path = ""
22
+ for root, dirs, files in os.walk('/app'):
23
+ if 'model.safetensors' in files:
24
+ actual_path = root
25
+ break
26
+
27
+ distil_tokenizer = DistilBertTokenizerFast.from_pretrained(actual_path)
28
+ distil_model = DistilBertForSequenceClassification.from_pretrained(actual_path)
29
 
30
  # 2. Knowledge Base & Retriever
31
  kb = [