Update app.py
Browse files
app.py
CHANGED
|
@@ -177,7 +177,7 @@ def umwandeln_fuer_anzeige(image):
|
|
| 177 |
####################################################
|
| 178 |
#aus einem Text-Prompt die Antwort von KI bekommen
|
| 179 |
#mit oder ohne RAG möglich
|
| 180 |
-
def generate_text (prompt, chatbot, history, vektordatenbank,
|
| 181 |
print("Text pur..............................")
|
| 182 |
if (prompt == ""):
|
| 183 |
raise gr.Error("Prompt ist erforderlich.")
|
|
@@ -257,10 +257,9 @@ def get_rag_response(question):
|
|
| 257 |
return response
|
| 258 |
|
| 259 |
|
| 260 |
-
|
| 261 |
|
| 262 |
#Eingaben der GUI verarbeiten
|
| 263 |
-
def generate_auswahl(prompt_in, file, file_history, chatbot, history, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3,top_k=5, validate=False):
|
| 264 |
global vektordatenbank, retriever
|
| 265 |
|
| 266 |
#nur wenn man sich validiert hat, kann die Anwendung los legen
|
|
@@ -476,7 +475,6 @@ with gr.Blocks(css=customCSS, theme=themeAlex) as demo:
|
|
| 476 |
max_context_length_tokens,
|
| 477 |
repetition_penalty,
|
| 478 |
top_k,
|
| 479 |
-
websuche,
|
| 480 |
validate
|
| 481 |
],
|
| 482 |
outputs=[chatbot, history, attached_file, attached_file_history, status_display],
|
|
|
|
| 177 |
####################################################
|
| 178 |
#aus einem Text-Prompt die Antwort von KI bekommen
|
| 179 |
#mit oder ohne RAG möglich
|
| 180 |
+
def generate_text (prompt, chatbot, history, vektordatenbank, top_p=0.6, temperature=0.2, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3, top_k=35):
|
| 181 |
print("Text pur..............................")
|
| 182 |
if (prompt == ""):
|
| 183 |
raise gr.Error("Prompt ist erforderlich.")
|
|
|
|
| 257 |
return response
|
| 258 |
|
| 259 |
|
|
|
|
| 260 |
|
| 261 |
#Eingaben der GUI verarbeiten
|
| 262 |
+
def generate_auswahl(prompt_in, file, file_history, chatbot, history, anzahl_docs=4, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3,top_k=5, validate=False):
|
| 263 |
global vektordatenbank, retriever
|
| 264 |
|
| 265 |
#nur wenn man sich validiert hat, kann die Anwendung los legen
|
|
|
|
| 475 |
max_context_length_tokens,
|
| 476 |
repetition_penalty,
|
| 477 |
top_k,
|
|
|
|
| 478 |
validate
|
| 479 |
],
|
| 480 |
outputs=[chatbot, history, attached_file, attached_file_history, status_display],
|