Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -395,9 +395,11 @@ def invoke (prompt, file, history, rag_option, model_option, openai_api_key, k=3
|
|
395 |
#llm = ChatOpenAI(model_name = MODEL_NAME_OAI_ZEICHNEN, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
|
396 |
data = {"inputs": prompt}
|
397 |
response = requests.post(API_URL, headers=HEADERS, json=data)
|
398 |
-
result = response.
|
399 |
-
|
400 |
-
|
|
|
|
|
401 |
print("history......................")
|
402 |
print(history)
|
403 |
return history, "Stop: Success"
|
|
|
395 |
#llm = ChatOpenAI(model_name = MODEL_NAME_OAI_ZEICHNEN, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
|
396 |
data = {"inputs": prompt}
|
397 |
response = requests.post(API_URL, headers=HEADERS, json=data)
|
398 |
+
result = response.json()["images"][0]
|
399 |
+
image_b64 = (f"data:image/jpeg;base64,{result}")
|
400 |
+
#result = response.content
|
401 |
+
#image = Image.open(io.BytesIO(result))
|
402 |
+
history[-1][1] = image_b64
|
403 |
print("history......................")
|
404 |
print(history)
|
405 |
return history, "Stop: Success"
|