Update pages/llm.py
Browse files- pages/llm.py +5 -3
pages/llm.py
CHANGED
@@ -36,7 +36,9 @@ def get_pdf_text(folder_path):
|
|
36 |
#text += '\n'
|
37 |
text=text.replace("\n", " ")
|
38 |
text=text.replace("- ", "")
|
39 |
-
|
|
|
|
|
40 |
|
41 |
#Chunks erstellen
|
42 |
def get_text_chunks(text):
|
@@ -98,8 +100,8 @@ def get_llm_answer(user_question):
|
|
98 |
|
99 |
# Frage beantworten mit Q&A Pipeline
|
100 |
answer = qa_pipeline(question=user_question, context=context, max_length=200)
|
101 |
-
|
102 |
-
return
|
103 |
|
104 |
def main():
|
105 |
st.set_page_config(
|
|
|
36 |
#text += '\n'
|
37 |
text=text.replace("\n", " ")
|
38 |
text=text.replace("- ", "")
|
39 |
+
text = translator.translate(text, dest ='en').text
|
40 |
+
st.text(text)
|
41 |
+
return text
|
42 |
|
43 |
#Chunks erstellen
|
44 |
def get_text_chunks(text):
|
|
|
100 |
|
101 |
# Frage beantworten mit Q&A Pipeline
|
102 |
answer = qa_pipeline(question=user_question, context=context, max_length=200)
|
103 |
+
antw = translator.translate(answer["answer"],dest='de')
|
104 |
+
return antw
|
105 |
|
106 |
def main():
|
107 |
st.set_page_config(
|