Update utils.py
Browse files
utils.py
CHANGED
@@ -352,7 +352,7 @@ def rag_chain(llm, prompt, retriever):
|
|
352 |
inputs = tokenizer_rag(input_text, return_tensors="pt", max_length=1024, truncation=True)
|
353 |
|
354 |
#Generiere die Antwort
|
355 |
-
outputs =
|
356 |
answer = tokenizer_rag.decode(outputs[0], skip_special_tokens=True)
|
357 |
|
358 |
|
|
|
352 |
inputs = tokenizer_rag(input_text, return_tensors="pt", max_length=1024, truncation=True)
|
353 |
|
354 |
#Generiere die Antwort
|
355 |
+
outputs = modell_rag.generate(inputs['input_ids'], max_length=150, num_beams=2, early_stopping=True)
|
356 |
answer = tokenizer_rag.decode(outputs[0], skip_special_tokens=True)
|
357 |
|
358 |
|