Update app.py
Browse files
app.py
CHANGED
@@ -425,7 +425,8 @@ 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 |
-
result = response.content
|
|
|
429 |
else:
|
430 |
print("ganz normale Ausführung.........................")
|
431 |
result = llm_chain(llm, history_text_und_prompt)
|
@@ -437,8 +438,11 @@ def invoke (prompt, file, history, rag_option, model_option, openai_api_key, k=3
|
|
437 |
|
438 |
if (prompt.find('zeichnen') != -1):
|
439 |
#Bild ausgeben
|
440 |
-
image = Image.open(io.BytesIO(result))
|
441 |
-
|
|
|
|
|
|
|
442 |
print("history zeichnen......................")
|
443 |
print(history)
|
444 |
if shared_state.interrupted:
|
|
|
425 |
else:
|
426 |
print("LLM aufrufen ohne RAG: ...........")
|
427 |
if (prompt.find('zeichnen') != -1):
|
428 |
+
#result = response.content
|
429 |
+
result = response.json()["images"]
|
430 |
else:
|
431 |
print("ganz normale Ausführung.........................")
|
432 |
result = llm_chain(llm, history_text_und_prompt)
|
|
|
438 |
|
439 |
if (prompt.find('zeichnen') != -1):
|
440 |
#Bild ausgeben
|
441 |
+
#image = Image.open(io.BytesIO(result))
|
442 |
+
for image in result:
|
443 |
+
image_b64 = (f"data:image/jpeg;base64,{image}")
|
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:
|