Spaces:
Running
Running
MarinaPlius
commited on
Commit
•
505d8f5
1
Parent(s):
b4cc323
connect model rag
Browse files
rag.py
CHANGED
@@ -17,12 +17,12 @@ class RAG:
|
|
17 |
|
18 |
# Download the vectorstore from Hugging Face Hub
|
19 |
|
20 |
-
def __init__(self, hf_token, embeddings_model, repo_name):
|
21 |
|
22 |
vectorstore = snapshot_download(repo_name)
|
23 |
|
24 |
|
25 |
-
|
26 |
self.hf_token = hf_token
|
27 |
# self.rerank_model = rerank_model
|
28 |
# self.rerank_number_contexts = rerank_number_contexts
|
@@ -153,8 +153,8 @@ class RAG:
|
|
153 |
|
154 |
del model_parameters["NUM_CHUNKS"]
|
155 |
|
156 |
-
|
157 |
-
response = "Output"
|
158 |
|
159 |
if not response:
|
160 |
return self.NO_ANSWER_MESSAGE
|
|
|
17 |
|
18 |
# Download the vectorstore from Hugging Face Hub
|
19 |
|
20 |
+
def __init__(self, hf_token, embeddings_model, repo_name,model_name):
|
21 |
|
22 |
vectorstore = snapshot_download(repo_name)
|
23 |
|
24 |
|
25 |
+
self.model_name = model_name
|
26 |
self.hf_token = hf_token
|
27 |
# self.rerank_model = rerank_model
|
28 |
# self.rerank_number_contexts = rerank_number_contexts
|
|
|
153 |
|
154 |
del model_parameters["NUM_CHUNKS"]
|
155 |
|
156 |
+
response = self.predict_completion(prompt, text_context, model_parameters)
|
157 |
+
#response = "Output"
|
158 |
|
159 |
if not response:
|
160 |
return self.NO_ANSWER_MESSAGE
|