Update pages/bot.py
Browse files- pages/bot.py +3 -2
pages/bot.py
CHANGED
@@ -96,6 +96,7 @@ def main():
|
|
96 |
st.text(user_question)
|
97 |
context=""+retrieved_docs[0].page_content+retrieved_docs[1].page_content+retrieved_docs[3].page_content
|
98 |
context=context.replace("\n", " ")
|
|
|
99 |
st.text("Das ist der Textausschnitt der durch den Retriever herausgesucht wird:")
|
100 |
st.text(context)
|
101 |
|
@@ -112,9 +113,9 @@ def main():
|
|
112 |
#st.text(answer)
|
113 |
|
114 |
#Die Basisantwort müsste man jetzt ausformulieren
|
115 |
-
text2text_generator = pipeline("text2text-generation")
|
116 |
#newText=text2text_generator(question=question, context=answer)
|
117 |
-
newText=text2text_generator("question: "+question+ "
|
118 |
st.text(newText)
|
119 |
|
120 |
if __name__ == '__main__':
|
|
|
96 |
st.text(user_question)
|
97 |
context=""+retrieved_docs[0].page_content+retrieved_docs[1].page_content+retrieved_docs[3].page_content
|
98 |
context=context.replace("\n", " ")
|
99 |
+
context=context.replace("- ", "")
|
100 |
st.text("Das ist der Textausschnitt der durch den Retriever herausgesucht wird:")
|
101 |
st.text(context)
|
102 |
|
|
|
113 |
#st.text(answer)
|
114 |
|
115 |
#Die Basisantwort müsste man jetzt ausformulieren
|
116 |
+
text2text_generator = pipeline("text2text-generation", model="google/flan-t5-base")
|
117 |
#newText=text2text_generator(question=question, context=answer)
|
118 |
+
newText=text2text_generator("question: "+question+ " answer: " + answer["answer"])
|
119 |
st.text(newText)
|
120 |
|
121 |
if __name__ == '__main__':
|