Update app.py
Browse files
app.py
CHANGED
|
@@ -209,6 +209,7 @@ def process_image(image_path, prompt):
|
|
| 209 |
##################################################
|
| 210 |
#openassistant um uploaded Files zu analysieren
|
| 211 |
def create_assistant(prompt, file):
|
|
|
|
| 212 |
#neues File dem Assistant hinzufügen
|
| 213 |
file_neu = client.files.create(file=open(file,"rb",),purpose="assistants",)
|
| 214 |
# Update Assistant
|
|
@@ -226,6 +227,7 @@ def create_assistant(prompt, file):
|
|
| 226 |
#Funktion wird direkt aufgerufen aus der GUI - von hier muss auch die Rückmeldung kommen....
|
| 227 |
#man kann einen Text-Prompt eingeben (mit oder ohne RAG), dazu ein Image hochladen, ein Bild zu einem reinen textprompt erzeugen lassen
|
| 228 |
def generate_auswahl(prompt, file, 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,):
|
|
|
|
| 229 |
#wenn RAG angeschaltet - Vektorstore initialisieren
|
| 230 |
#aber nur, wenn es noch nicht geshehen ist (splittet = False)
|
| 231 |
if (rag_option == "An"):
|
|
@@ -268,6 +270,7 @@ def generate_auswahl(prompt, file, chatbot, history, rag_option, model_option, o
|
|
| 268 |
##################################################
|
| 269 |
#zu einem Text-Prompt ein Bild via Stable Diffusion generieren
|
| 270 |
def generate_bild(prompt, chatbot, model_option_zeichnen='HuggingFace', temperature=0.5, max_new_tokens=4048,top_p=0.6, repetition_penalty=1.3):
|
|
|
|
| 271 |
if (model_option_zeichnen == "Stable Diffusion"):
|
| 272 |
print("Bild Erzeugung HF..............................")
|
| 273 |
#Bild nach Anweisung zeichnen und in History darstellen...
|
|
|
|
| 209 |
##################################################
|
| 210 |
#openassistant um uploaded Files zu analysieren
|
| 211 |
def create_assistant(prompt, file):
|
| 212 |
+
global client, general_assistant
|
| 213 |
#neues File dem Assistant hinzufügen
|
| 214 |
file_neu = client.files.create(file=open(file,"rb",),purpose="assistants",)
|
| 215 |
# Update Assistant
|
|
|
|
| 227 |
#Funktion wird direkt aufgerufen aus der GUI - von hier muss auch die Rückmeldung kommen....
|
| 228 |
#man kann einen Text-Prompt eingeben (mit oder ohne RAG), dazu ein Image hochladen, ein Bild zu einem reinen textprompt erzeugen lassen
|
| 229 |
def generate_auswahl(prompt, file, 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,):
|
| 230 |
+
global splittet
|
| 231 |
#wenn RAG angeschaltet - Vektorstore initialisieren
|
| 232 |
#aber nur, wenn es noch nicht geshehen ist (splittet = False)
|
| 233 |
if (rag_option == "An"):
|
|
|
|
| 270 |
##################################################
|
| 271 |
#zu einem Text-Prompt ein Bild via Stable Diffusion generieren
|
| 272 |
def generate_bild(prompt, chatbot, model_option_zeichnen='HuggingFace', temperature=0.5, max_new_tokens=4048,top_p=0.6, repetition_penalty=1.3):
|
| 273 |
+
global client
|
| 274 |
if (model_option_zeichnen == "Stable Diffusion"):
|
| 275 |
print("Bild Erzeugung HF..............................")
|
| 276 |
#Bild nach Anweisung zeichnen und in History darstellen...
|