Update src/streamlit_app.py
Browse files- src/streamlit_app.py +6 -3
src/streamlit_app.py
CHANGED
@@ -4,7 +4,7 @@ import numpy as np
|
|
4 |
import pandas as pd
|
5 |
from sentence_transformers import SentenceTransformer
|
6 |
import pickle
|
7 |
-
from
|
8 |
from transformers import AutoTokenizer, AutoModel
|
9 |
import torch
|
10 |
|
@@ -63,8 +63,11 @@ def get_ollama_explanation(query, description):
|
|
63 |
response = llm.invoke(prompt)
|
64 |
return response.content.strip()
|
65 |
|
66 |
-
# Load
|
67 |
-
llm =
|
|
|
|
|
|
|
68 |
|
69 |
# Initialize app
|
70 |
st.set_page_config(page_title="Fragrance Recommendation System", layout="wide")
|
|
|
4 |
import pandas as pd
|
5 |
from sentence_transformers import SentenceTransformer
|
6 |
import pickle
|
7 |
+
from langchain_huggingface import HuggingFaceEndpoint
|
8 |
from transformers import AutoTokenizer, AutoModel
|
9 |
import torch
|
10 |
|
|
|
63 |
response = llm.invoke(prompt)
|
64 |
return response.content.strip()
|
65 |
|
66 |
+
# Load LLM
|
67 |
+
llm = HuggingFaceEndpoint(
|
68 |
+
repo_id="mistralai/Mistral-7B-Instruct-v0.3",
|
69 |
+
huggingfacehub_api_token=os.environ["HF_TOKEN"]
|
70 |
+
)
|
71 |
|
72 |
# Initialize app
|
73 |
st.set_page_config(page_title="Fragrance Recommendation System", layout="wide")
|