MaxGit32 commited on
Commit
ebec180
1 Parent(s): a62a4cc

Update pages/llm.py

Browse files
Files changed (1) hide show
  1. pages/llm.py +5 -5
pages/llm.py CHANGED
@@ -92,16 +92,16 @@ def get_llm_answer(user_question):
92
  # Top 3 Suchergebnisse des Retrievers als Context speichern
93
  context=""+retrieved_docs[0].page_content+retrieved_docs[1].page_content+retrieved_docs[2].page_content
94
  # Context bereinigen
95
- context=context.replace("\n", " ")
96
- context=context.replace("- ", "")
97
 
98
  # Erstelle die Question Answering-Pipeline für Deutsch
99
- qa_pipeline = pipeline("question-answering", model="deutsche-telekom/bert-multi-english-german-squad2", tokenizer="deutsche-telekom/bert-multi-english-german-squad2")
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 answer["answer"]#antw
105
 
106
  def main():
107
  st.set_page_config(
 
92
  # Top 3 Suchergebnisse des Retrievers als Context speichern
93
  context=""+retrieved_docs[0].page_content+retrieved_docs[1].page_content+retrieved_docs[2].page_content
94
  # Context bereinigen
95
+ #context=context.replace("\n", " ")
96
+ #context=context.replace("- ", "")
97
 
98
  # Erstelle die Question Answering-Pipeline für Deutsch
99
+ #qa_pipeline = pipeline("question-answering", model="deutsche-telekom/bert-multi-english-german-squad2", tokenizer="deutsche-telekom/bert-multi-english-german-squad2")
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 content#answer["answer"]#antw
105
 
106
  def main():
107
  st.set_page_config(