Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ def initialize(file_path, question):
|
|
41 |
mistral_prompt = f"Based on this answer: {gemini_answer}\nGenerate a follow-up question:"
|
42 |
mistral_inputs = mistral_tokenizer.encode(mistral_prompt, return_tensors='pt').to(device)
|
43 |
with torch.no_grad():
|
44 |
-
mistral_outputs = mistral_model.generate(mistral_inputs, max_length=
|
45 |
mistral_output = mistral_tokenizer.decode(mistral_outputs[0], skip_special_tokens=True)
|
46 |
|
47 |
combined_output = f"Gemini Answer: {gemini_answer}\n\nMistral Follow-up: {mistral_output}"
|
@@ -68,4 +68,5 @@ gr.Interface(
|
|
68 |
outputs=output_text,
|
69 |
title="RAG Knowledge Retrieval using Gemini API and Mistral Model",
|
70 |
description="Upload a PDF file and ask questions about the content."
|
71 |
-
).launch()
|
|
|
|
41 |
mistral_prompt = f"Based on this answer: {gemini_answer}\nGenerate a follow-up question:"
|
42 |
mistral_inputs = mistral_tokenizer.encode(mistral_prompt, return_tensors='pt').to(device)
|
43 |
with torch.no_grad():
|
44 |
+
mistral_outputs = mistral_model.generate(mistral_inputs, max_length=150)
|
45 |
mistral_output = mistral_tokenizer.decode(mistral_outputs[0], skip_special_tokens=True)
|
46 |
|
47 |
combined_output = f"Gemini Answer: {gemini_answer}\n\nMistral Follow-up: {mistral_output}"
|
|
|
68 |
outputs=output_text,
|
69 |
title="RAG Knowledge Retrieval using Gemini API and Mistral Model",
|
70 |
description="Upload a PDF file and ask questions about the content."
|
71 |
+
).launch()
|
72 |
+
#
|