Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -423,6 +423,7 @@ def invoke (prompt, file, history, rag_option, model_option, openai_api_key, k=3
|
|
| 423 |
if (prompt.find('Bild zeichnen') != -1):
|
| 424 |
response = requests.post(API_URL, headers=HEADERS, json=data)
|
| 425 |
result = response.content
|
|
|
|
| 426 |
else:
|
| 427 |
result = llm_chain(llm, history_text_und_prompt)
|
| 428 |
|
|
@@ -432,7 +433,7 @@ def invoke (prompt, file, history, rag_option, model_option, openai_api_key, k=3
|
|
| 432 |
|
| 433 |
|
| 434 |
if (prompt.find('Bild zeichnen') != -1):
|
| 435 |
-
history[-1][1] =
|
| 436 |
return history, "Stop: Success"
|
| 437 |
else:
|
| 438 |
#Antwort als Stream ausgeben... wenn Textantwort gefordert
|
|
|
|
| 423 |
if (prompt.find('Bild zeichnen') != -1):
|
| 424 |
response = requests.post(API_URL, headers=HEADERS, json=data)
|
| 425 |
result = response.content
|
| 426 |
+
image = Image.open(io.BytesIO(result))
|
| 427 |
else:
|
| 428 |
result = llm_chain(llm, history_text_und_prompt)
|
| 429 |
|
|
|
|
| 433 |
|
| 434 |
|
| 435 |
if (prompt.find('Bild zeichnen') != -1):
|
| 436 |
+
history[-1][1] = image
|
| 437 |
return history, "Stop: Success"
|
| 438 |
else:
|
| 439 |
#Antwort als Stream ausgeben... wenn Textantwort gefordert
|