Update app.py
Browse files
app.py
CHANGED
@@ -364,7 +364,8 @@ def umwandeln_fuer_anzeige(image):
|
|
364 |
|
365 |
def generate_auswahl(prompt, file, 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,):
|
366 |
if (prompt.find('zeichnen') != -1):
|
367 |
-
|
|
|
368 |
#Bild ausgeben
|
369 |
image = Image.open(io.BytesIO(result))
|
370 |
|
@@ -398,8 +399,7 @@ def generate_bild(prompt):
|
|
398 |
data = {"inputs": prompt}
|
399 |
response = requests.post(API_URL, headers=HEADERS, json=data)
|
400 |
print("fertig Bild")
|
401 |
-
|
402 |
-
return result
|
403 |
|
404 |
def generate_text (prompt, file, 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,):
|
405 |
global splittet
|
|
|
364 |
|
365 |
def generate_auswahl(prompt, file, 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,):
|
366 |
if (prompt.find('zeichnen') != -1):
|
367 |
+
response = generate_bild(prompt)
|
368 |
+
result = response.content
|
369 |
#Bild ausgeben
|
370 |
image = Image.open(io.BytesIO(result))
|
371 |
|
|
|
399 |
data = {"inputs": prompt}
|
400 |
response = requests.post(API_URL, headers=HEADERS, json=data)
|
401 |
print("fertig Bild")
|
402 |
+
return response
|
|
|
403 |
|
404 |
def generate_text (prompt, file, 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,):
|
405 |
global splittet
|