Update app.py
Browse files
app.py
CHANGED
@@ -245,13 +245,15 @@ def generate_bild(prompt, chatbot, temperature=0.5, max_new_tokens=4048,top_p=0
|
|
245 |
response = client.images.generate(model="dall-e-3",prompt=prompt,size="1024x1024",quality="standard",n=1, response_format='b64_json')
|
246 |
print("response.........................")
|
247 |
print(response)
|
|
|
|
|
248 |
#with open(image_path, "rb") as image_file:
|
249 |
#return base64.b64encode(image_file.read()).decode('utf-8')
|
250 |
|
251 |
#image = Image.open(io.BytesIO(response))
|
252 |
#image_64 = umwandeln_fuer_anzeige(image)
|
253 |
#chatbot[-1][1]= "<img src='data:image/png;base64,{0}'/>".format(base64.b64encode(image_64).decode('utf-8'))
|
254 |
-
chatbot[-1][1] = "<img src='data:image/png;base64,{0}'/>".format(response)
|
255 |
return chatbot, "Success"
|
256 |
|
257 |
|
|
|
245 |
response = client.images.generate(model="dall-e-3",prompt=prompt,size="1024x1024",quality="standard",n=1, response_format='b64_json')
|
246 |
print("response.........................")
|
247 |
print(response)
|
248 |
+
print("data........................")
|
249 |
+
print(response.data[0].b64_json)
|
250 |
#with open(image_path, "rb") as image_file:
|
251 |
#return base64.b64encode(image_file.read()).decode('utf-8')
|
252 |
|
253 |
#image = Image.open(io.BytesIO(response))
|
254 |
#image_64 = umwandeln_fuer_anzeige(image)
|
255 |
#chatbot[-1][1]= "<img src='data:image/png;base64,{0}'/>".format(base64.b64encode(image_64).decode('utf-8'))
|
256 |
+
chatbot[-1][1] = "<img src='data:image/png;base64,{0}'/>".format(response.data[0].b64_json)
|
257 |
return chatbot, "Success"
|
258 |
|
259 |
|