Spaces:
Running
Running
TahaFawzyElshrif commited on
Commit ·
447cf52
1
Parent(s): 287bd53
work on bug of running
Browse files- Server.py +1 -1
- agent/rag/rag.py +3 -0
Server.py
CHANGED
|
@@ -27,7 +27,7 @@ def get_response(prompt,memory,hf_key,state,user_email,user_name):
|
|
| 27 |
llm_gpt = ChatHuggingFace(llm=llm_gpt)
|
| 28 |
|
| 29 |
print("RAG_PATH ",os.path.join(os.path.dirname(__file__), 'agent' ,'rag', 'rag.xlsx'), os.path.exists(os.path.join(os.path.dirname(__file__), 'agent' ,'rag', 'rag.xlsx')))
|
| 30 |
-
|
| 31 |
rag_model = rag_text_chooser(os.path.join(os.path.dirname(__file__), 'agent' ,'rag', 'rag.xlsx'))
|
| 32 |
|
| 33 |
# update state
|
|
|
|
| 27 |
llm_gpt = ChatHuggingFace(llm=llm_gpt)
|
| 28 |
|
| 29 |
print("RAG_PATH ",os.path.join(os.path.dirname(__file__), 'agent' ,'rag', 'rag.xlsx'), os.path.exists(os.path.join(os.path.dirname(__file__), 'agent' ,'rag', 'rag.xlsx')))
|
| 30 |
+
|
| 31 |
rag_model = rag_text_chooser(os.path.join(os.path.dirname(__file__), 'agent' ,'rag', 'rag.xlsx'))
|
| 32 |
|
| 33 |
# update state
|
agent/rag/rag.py
CHANGED
|
@@ -6,9 +6,12 @@ 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 |
|
| 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 |
|
|
|
|
| 6 |
class rag_text_chooser:
|
| 7 |
def __init__(self,data_rag):
|
| 8 |
self.data_rag = pd.read_excel(data_rag)
|
| 9 |
+
print(self.data_rag)
|
| 10 |
|
| 11 |
self.corpus, self.answers = self.get_questions_Answers()
|
| 12 |
+
print(self.corpus)
|
| 13 |
self.model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
| 14 |
+
print(self.model)
|
| 15 |
self.corpus_embeddings = self.model.encode(self.corpus)
|
| 16 |
|
| 17 |
|