Update app.py
Browse files
app.py
CHANGED
|
@@ -326,7 +326,7 @@ def create_assistant_suche_hf(chatbot, prompt):
|
|
| 326 |
#man kann einen Text-Prompt eingeben (mit oder ohne RAG), dazu ein Image hochladen, ein Bild zu einem reinen textprompt erzeugen lassen
|
| 327 |
def generate_auswahl(prompt_in, file, file_history, chatbot, history, rag_option, model_option, openai_api_key, 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, websuche="Aus", validate=False):
|
| 328 |
global vektorstore, retriever
|
| 329 |
-
|
| 330 |
#nur wenn man sich validiert hat, kann die Anwendung los legen
|
| 331 |
if (validate and not prompt_in == "" and not prompt_in == None):
|
| 332 |
#wenn RAG angeschaltet - Vektorstore initialisieren
|
|
@@ -339,10 +339,10 @@ def generate_auswahl(prompt_in, file, file_history, chatbot, history, rag_option
|
|
| 339 |
|
| 340 |
if (rag_option == "An"):
|
| 341 |
#muss nur einmal ausgeführt werden...
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
|
| 347 |
#kein Bild hochgeladen -> auf Text antworten...
|
| 348 |
status = "Antwort der KI ..."
|
|
|
|
| 326 |
#man kann einen Text-Prompt eingeben (mit oder ohne RAG), dazu ein Image hochladen, ein Bild zu einem reinen textprompt erzeugen lassen
|
| 327 |
def generate_auswahl(prompt_in, file, file_history, chatbot, history, rag_option, model_option, openai_api_key, 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, websuche="Aus", validate=False):
|
| 328 |
global vektorstore, retriever
|
| 329 |
+
|
| 330 |
#nur wenn man sich validiert hat, kann die Anwendung los legen
|
| 331 |
if (validate and not prompt_in == "" and not prompt_in == None):
|
| 332 |
#wenn RAG angeschaltet - Vektorstore initialisieren
|
|
|
|
| 339 |
|
| 340 |
if (rag_option == "An"):
|
| 341 |
#muss nur einmal ausgeführt werden...
|
| 342 |
+
if vectorstore == None:
|
| 343 |
+
print("db neu aufbauen!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1")
|
| 344 |
+
splits = document_loading_splitting()
|
| 345 |
+
vectorstore, retriever = document_storage_chroma(splits)
|
| 346 |
|
| 347 |
#kein Bild hochgeladen -> auf Text antworten...
|
| 348 |
status = "Antwort der KI ..."
|