Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, AutoModelForSequen
|
|
10 |
sent = "dnzblgn/Sentiment-Analysis-Customer-Reviews"
|
11 |
sarc = "dnzblgn/Sarcasm-Detection-Customer-Reviews"
|
12 |
doc = "dnzblgn/Customer-Reviews-Classification"
|
13 |
-
embedding_model = SentenceTransformer('all-MiniLM-L6-v2')
|
14 |
|
15 |
# Your models (no token, no fast tokenizer)
|
16 |
sentiment_tokenizer = AutoTokenizer.from_pretrained("dnzblgn/Sentiment-Analysis-Customer-Reviews", use_fast=False)
|
@@ -22,9 +22,10 @@ sarcasm_model = AutoModelForSequenceClassification.from_pretrained("dnzblgn/Sarc
|
|
22 |
classification_tokenizer = AutoTokenizer.from_pretrained("dnzblgn/Customer-Reviews-Classification", use_fast=False)
|
23 |
classification_model = AutoModelForSequenceClassification.from_pretrained("dnzblgn/Customer-Reviews-Classification")
|
24 |
|
25 |
-
#
|
26 |
-
|
27 |
-
|
|
|
28 |
|
29 |
# Paths and files
|
30 |
UPLOAD_FOLDER = "uploads"
|
|
|
10 |
sent = "dnzblgn/Sentiment-Analysis-Customer-Reviews"
|
11 |
sarc = "dnzblgn/Sarcasm-Detection-Customer-Reviews"
|
12 |
doc = "dnzblgn/Customer-Reviews-Classification"
|
13 |
+
embedding_model = SentenceTransformer('all-MiniLM-L6-v2')
|
14 |
|
15 |
# Your models (no token, no fast tokenizer)
|
16 |
sentiment_tokenizer = AutoTokenizer.from_pretrained("dnzblgn/Sentiment-Analysis-Customer-Reviews", use_fast=False)
|
|
|
22 |
classification_tokenizer = AutoTokenizer.from_pretrained("dnzblgn/Customer-Reviews-Classification", use_fast=False)
|
23 |
classification_model = AutoModelForSequenceClassification.from_pretrained("dnzblgn/Customer-Reviews-Classification")
|
24 |
|
25 |
+
# ** Mistral model for RAG **
|
26 |
+
mistral_model_name = "mistralai/Mistral-7B-v0.1"
|
27 |
+
causal_tokenizer = AutoTokenizer.from_pretrained(mistral_model_name)
|
28 |
+
causal_model = AutoModelForCausalLM.from_pretrained(mistral_model_name, torch_dtype=torch.float16).eval()
|
29 |
|
30 |
# Paths and files
|
31 |
UPLOAD_FOLDER = "uploads"
|