Spaces:
Running
Running
TahaFawzyElshrif commited on
Commit ·
8b208f1
1
Parent(s): 81e5d6f
uploaded files
Browse files- agent/rag/rag.py +1 -4
agent/rag/rag.py
CHANGED
|
@@ -6,11 +6,9 @@ import pandas as pd
|
|
| 6 |
class rag_text_chooser:
|
| 7 |
def __init__(self,data_rag):
|
| 8 |
self.data_rag = pd.read_excel(data_rag)
|
| 9 |
-
print("data_rag", self.data_rag)
|
| 10 |
|
| 11 |
self.corpus, self.answers = self.get_questions_Answers()
|
| 12 |
self.model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
| 13 |
-
print(self.model)
|
| 14 |
self.corpus_embeddings = self.model.encode(self.corpus)
|
| 15 |
|
| 16 |
|
|
@@ -21,8 +19,7 @@ class rag_text_chooser:
|
|
| 21 |
answers = []
|
| 22 |
|
| 23 |
for _, row in self.data_rag.iterrows():
|
| 24 |
-
|
| 25 |
-
questions.append(row.iloc[0]) # العمود الأول
|
| 26 |
answers.append(row.iloc[1])
|
| 27 |
|
| 28 |
return questions, answers
|
|
|
|
| 6 |
class rag_text_chooser:
|
| 7 |
def __init__(self,data_rag):
|
| 8 |
self.data_rag = pd.read_excel(data_rag)
|
|
|
|
| 9 |
|
| 10 |
self.corpus, self.answers = self.get_questions_Answers()
|
| 11 |
self.model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
|
|
|
| 12 |
self.corpus_embeddings = self.model.encode(self.corpus)
|
| 13 |
|
| 14 |
|
|
|
|
| 19 |
answers = []
|
| 20 |
|
| 21 |
for _, row in self.data_rag.iterrows():
|
| 22 |
+
questions.append(row.iloc[0])
|
|
|
|
| 23 |
answers.append(row.iloc[1])
|
| 24 |
|
| 25 |
return questions, answers
|