Update app.py
Browse files
app.py
CHANGED
|
@@ -207,9 +207,7 @@ def generate_text (prompt, chatbot, history, vektordatenbank, retriever, top_p=0
|
|
| 207 |
# Erstelle eine HuggingFaceEndPoints-Instanz mit den entsprechenden Endpunkt-Parametern
|
| 208 |
llm = HuggingFaceEndpoint(
|
| 209 |
endpoint_url=f"https://api-inference.huggingface.co/models/{MODEL_NAME_HF}",
|
| 210 |
-
api_key=hf_token,
|
| 211 |
-
temperature=0.5,
|
| 212 |
-
max_length=512,
|
| 213 |
top_k=top_k,
|
| 214 |
top_p=top_p,
|
| 215 |
repetition_penalty=repetition_penalty
|
|
@@ -274,8 +272,10 @@ def generate_auswahl(prompt_in, file, file_history, chatbot, history, anzahl_doc
|
|
| 274 |
print("summary:....................." + summary)
|
| 275 |
history = history + [[prompt_in, summary]]
|
| 276 |
print("history.........................."+str(history))
|
| 277 |
-
|
| 278 |
-
|
|
|
|
|
|
|
| 279 |
chatbot[-1][1] = ""
|
| 280 |
for character in summary:
|
| 281 |
chatbot[-1][1] += character
|
|
@@ -287,7 +287,7 @@ def generate_auswahl(prompt_in, file, file_history, chatbot, history, anzahl_doc
|
|
| 287 |
yield chatbot, history, None, neu_file, "Stop: Success"
|
| 288 |
except:
|
| 289 |
pass
|
| 290 |
-
|
| 291 |
|
| 292 |
|
| 293 |
else: #noch nicht validiert, oder kein Prompt
|
|
|
|
| 207 |
# Erstelle eine HuggingFaceEndPoints-Instanz mit den entsprechenden Endpunkt-Parametern
|
| 208 |
llm = HuggingFaceEndpoint(
|
| 209 |
endpoint_url=f"https://api-inference.huggingface.co/models/{MODEL_NAME_HF}",
|
| 210 |
+
model_kwargs={api_key=hf_token, temperature=0.5, max_length=512},
|
|
|
|
|
|
|
| 211 |
top_k=top_k,
|
| 212 |
top_p=top_p,
|
| 213 |
repetition_penalty=repetition_penalty
|
|
|
|
| 272 |
print("summary:....................." + summary)
|
| 273 |
history = history + [[prompt_in, summary]]
|
| 274 |
print("history.........................."+str(history))
|
| 275 |
+
chatbot[-1][1] = summary
|
| 276 |
+
return chatbot, history, None, file_history, ""
|
| 277 |
+
|
| 278 |
+
"""
|
| 279 |
chatbot[-1][1] = ""
|
| 280 |
for character in summary:
|
| 281 |
chatbot[-1][1] += character
|
|
|
|
| 287 |
yield chatbot, history, None, neu_file, "Stop: Success"
|
| 288 |
except:
|
| 289 |
pass
|
| 290 |
+
"""
|
| 291 |
|
| 292 |
|
| 293 |
else: #noch nicht validiert, oder kein Prompt
|