Update app.py
Browse files
app.py
CHANGED
@@ -425,8 +425,7 @@ def invoke (prompt, file, history, rag_option, model_option, openai_api_key, k=3
|
|
425 |
else:
|
426 |
print("LLM aufrufen ohne RAG: ...........")
|
427 |
if (prompt.find('zeichnen') != -1):
|
428 |
-
|
429 |
-
result = response.json()["images"]
|
430 |
else:
|
431 |
print("ganz normale Ausführung.........................")
|
432 |
result = llm_chain(llm, history_text_und_prompt)
|
@@ -438,11 +437,9 @@ def invoke (prompt, file, history, rag_option, model_option, openai_api_key, k=3
|
|
438 |
|
439 |
if (prompt.find('zeichnen') != -1):
|
440 |
#Bild ausgeben
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
images.append(image_b64)
|
445 |
-
history[-1][1] = images[0] #file.name,
|
446 |
print("history zeichnen......................")
|
447 |
print(history)
|
448 |
if shared_state.interrupted:
|
|
|
425 |
else:
|
426 |
print("LLM aufrufen ohne RAG: ...........")
|
427 |
if (prompt.find('zeichnen') != -1):
|
428 |
+
result = response.content
|
|
|
429 |
else:
|
430 |
print("ganz normale Ausführung.........................")
|
431 |
result = llm_chain(llm, history_text_und_prompt)
|
|
|
437 |
|
438 |
if (prompt.find('zeichnen') != -1):
|
439 |
#Bild ausgeben
|
440 |
+
image = Image.open(io.BytesIO(result))
|
441 |
+
image_png = image.getValue()
|
442 |
+
history[-1][1] = image_png #file.name,
|
|
|
|
|
443 |
print("history zeichnen......................")
|
444 |
print(history)
|
445 |
if shared_state.interrupted:
|