Removed Tokenizer from RemoteRag
Browse files
app.py
CHANGED
@@ -316,9 +316,9 @@ class BSIChatbot:
|
|
316 |
Question: {question}""",
|
317 |
},
|
318 |
]
|
319 |
-
RAG_PROMPT_TEMPLATE = self.llmtokenizer.apply_chat_template(
|
320 |
-
|
321 |
-
)
|
322 |
retrieved_chunks = self.retrieveSimiliarEmbedding(query)
|
323 |
retrieved_chunks_text = []
|
324 |
#TODO Irgendwas stimmt hier mit den Listen nicht
|
@@ -351,7 +351,7 @@ class BSIChatbot:
|
|
351 |
context = "\nExtracted documents:\n"
|
352 |
context += "".join([doc for i, doc in enumerate(retrieved_chunks_text)])
|
353 |
#Alles außer letzte Useranfrage
|
354 |
-
final_prompt =
|
355 |
question=query, context=context, history=history[:-1]
|
356 |
)
|
357 |
|
@@ -529,9 +529,9 @@ if __name__ == '__main__':
|
|
529 |
|
530 |
def gradiobot(history: list):
|
531 |
start = time.time()
|
532 |
-
print(f"ragQuery hist -1:{history[-1].get('content')}")
|
533 |
-
print(f"ragQuery hist 0:{history[0].get('content')}")
|
534 |
-
print(f"fullHistory: {history}" )
|
535 |
bot_response = bot.ragPromptRemote(history[-1].get('content'), reranking, history)
|
536 |
history.append({"role": "assistant", "content": ""})
|
537 |
|
|
|
316 |
Question: {question}""",
|
317 |
},
|
318 |
]
|
319 |
+
#RAG_PROMPT_TEMPLATE = self.llmtokenizer.apply_chat_template(
|
320 |
+
# prompt_in_chat_format, tokenize=False, add_generation_prompt=True
|
321 |
+
#)
|
322 |
retrieved_chunks = self.retrieveSimiliarEmbedding(query)
|
323 |
retrieved_chunks_text = []
|
324 |
#TODO Irgendwas stimmt hier mit den Listen nicht
|
|
|
351 |
context = "\nExtracted documents:\n"
|
352 |
context += "".join([doc for i, doc in enumerate(retrieved_chunks_text)])
|
353 |
#Alles außer letzte Useranfrage
|
354 |
+
final_prompt = prompt_in_chat_format.format(
|
355 |
question=query, context=context, history=history[:-1]
|
356 |
)
|
357 |
|
|
|
529 |
|
530 |
def gradiobot(history: list):
|
531 |
start = time.time()
|
532 |
+
print(f"DBG: ragQuery hist -1:{history[-1].get('content')}")
|
533 |
+
print(f"DBG: ragQuery hist 0:{history[0].get('content')}")
|
534 |
+
print(f"DBG: fullHistory: {history}" )
|
535 |
bot_response = bot.ragPromptRemote(history[-1].get('content'), reranking, history)
|
536 |
history.append({"role": "assistant", "content": ""})
|
537 |
|