Update app.py
Browse files
app.py
CHANGED
|
@@ -309,8 +309,7 @@ def generate_auswahl(prompt_in, file, file_history, chatbot, history, rag_option
|
|
| 309 |
#aber nur, wenn es noch nicht geshehen ist (splittet = False)
|
| 310 |
#falls schon ein File hochgeladen wurde, ist es in history_file gespeichert - falls ein neues File hochgeladen wurde, wird es anschließend neu gesetzt
|
| 311 |
neu_file = file_history
|
| 312 |
-
|
| 313 |
-
print(websuche)
|
| 314 |
#prompt normalisieren bevor er an die KIs geht
|
| 315 |
prompt = normalise_prompt(prompt_in)
|
| 316 |
|
|
@@ -328,7 +327,7 @@ def generate_auswahl(prompt_in, file, file_history, chatbot, history, rag_option
|
|
| 328 |
#kein Bild hochgeladen -> auf Text antworten...
|
| 329 |
status = "Antwort der KI ..."
|
| 330 |
if (file == None and file_history == None):
|
| 331 |
-
result, status = generate_text(prompt, chatbot, history, rag_option, model_option, openai_api_key, db, k=3, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3, top_k=
|
| 332 |
history = history + [[prompt, result]]
|
| 333 |
else:
|
| 334 |
#Es wurde ein File neu angehängt -> wenn prompt dazu, das Bild analysieren
|
|
@@ -432,7 +431,7 @@ def generate_text_zu_doc(file, prompt, k, rag_option, chatbot, history, db):
|
|
| 432 |
####################################################
|
| 433 |
#aus einem Text-Prompt die Antwort von KI bekommen
|
| 434 |
#mit oder ohne RAG möglich
|
| 435 |
-
def generate_text (prompt, chatbot, history, rag_option, model_option, openai_api_key, db, k=3, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3, top_k=35
|
| 436 |
global splittet
|
| 437 |
hugchat=False
|
| 438 |
suche_im_Netz="Antwort der KI ..."
|
|
|
|
| 309 |
#aber nur, wenn es noch nicht geshehen ist (splittet = False)
|
| 310 |
#falls schon ein File hochgeladen wurde, ist es in history_file gespeichert - falls ein neues File hochgeladen wurde, wird es anschließend neu gesetzt
|
| 311 |
neu_file = file_history
|
| 312 |
+
|
|
|
|
| 313 |
#prompt normalisieren bevor er an die KIs geht
|
| 314 |
prompt = normalise_prompt(prompt_in)
|
| 315 |
|
|
|
|
| 327 |
#kein Bild hochgeladen -> auf Text antworten...
|
| 328 |
status = "Antwort der KI ..."
|
| 329 |
if (file == None and file_history == None):
|
| 330 |
+
result, status = generate_text(prompt, chatbot, history, rag_option, model_option, openai_api_key, db, websuche, k=3, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3, top_k=3)
|
| 331 |
history = history + [[prompt, result]]
|
| 332 |
else:
|
| 333 |
#Es wurde ein File neu angehängt -> wenn prompt dazu, das Bild analysieren
|
|
|
|
| 431 |
####################################################
|
| 432 |
#aus einem Text-Prompt die Antwort von KI bekommen
|
| 433 |
#mit oder ohne RAG möglich
|
| 434 |
+
def generate_text (prompt, chatbot, history, rag_option, model_option, openai_api_key, db, websuche, k=3, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3, top_k=35):
|
| 435 |
global splittet
|
| 436 |
hugchat=False
|
| 437 |
suche_im_Netz="Antwort der KI ..."
|