Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -57,8 +57,8 @@ embedding_model_bge = "BAAI/bge-base-en-v1.5"
|
|
57 |
#save_path_bge = "./models/bge-base-en-v1.5"
|
58 |
faiss_index_path = "./qa_faiss_embedding.index"
|
59 |
chunked_text_path = "./chunked_text_RAG_text.txt"
|
60 |
-
|
61 |
-
READER_MODEL_NAME = "google/gemma-2b-it"
|
62 |
log_file_path = "./diagnosis_logs.csv"
|
63 |
feedback_file_path = "./feedback_logs.csv"
|
64 |
|
@@ -157,18 +157,18 @@ emotion_classifier = hf_pipeline("text-classification", model="nateraw/bert-base
|
|
157 |
# )
|
158 |
|
159 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
160 |
-
|
161 |
-
#
|
162 |
-
|
163 |
-
|
164 |
-
model_id = "mistralai/Mistral-7B-Instruct-v0.1"
|
165 |
-
#model_id = "TheBloke/Gemma-2-7B-IT-GGUF"
|
166 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
167 |
-
model = AutoModelForCausalLM.from_pretrained(
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
).to(device)
|
172 |
|
173 |
READER_LLM = pipeline(
|
174 |
model=model,
|
|
|
57 |
#save_path_bge = "./models/bge-base-en-v1.5"
|
58 |
faiss_index_path = "./qa_faiss_embedding.index"
|
59 |
chunked_text_path = "./chunked_text_RAG_text.txt"
|
60 |
+
READER_MODEL_NAME = "google/gemma-2-9b-it"
|
61 |
+
#READER_MODEL_NAME = "google/gemma-2b-it"
|
62 |
log_file_path = "./diagnosis_logs.csv"
|
63 |
feedback_file_path = "./feedback_logs.csv"
|
64 |
|
|
|
157 |
# )
|
158 |
|
159 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
160 |
+
tokenizer = AutoTokenizer.from_pretrained(READER_MODEL_NAME)
|
161 |
+
#model = AutoModelForCausalLM.from_pretrained(READER_MODEL_NAME)
|
162 |
+
model = AutoModelForCausalLM.from_pretrained(READER_MODEL_NAME).to(device)
|
163 |
+
|
164 |
+
# model_id = "mistralai/Mistral-7B-Instruct-v0.1"
|
165 |
+
# #model_id = "TheBloke/Gemma-2-7B-IT-GGUF"
|
166 |
+
# tokenizer = AutoTokenizer.from_pretrained(model_id)
|
167 |
+
# model = AutoModelForCausalLM.from_pretrained(
|
168 |
+
# model_id,
|
169 |
+
# torch_dtype=torch.float16,
|
170 |
+
# device_map="auto",
|
171 |
+
# ).to(device)
|
172 |
|
173 |
READER_LLM = pipeline(
|
174 |
model=model,
|