alexkueck commited on
Commit
b4127d8
1 Parent(s): 258c3d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -243,7 +243,14 @@ def generate_bild(prompt, chatbot, temperature=0.5, max_new_tokens=4048,top_p=0
243
  client = OpenAI()
244
  #als Format ginge auch 'b64_json', n - Anz. der erzeugten Bilder
245
  response = client.images.generate(model="dall-e-3",prompt=prompt,size="1024x1024",quality="standard",n=1, response_format='url')
246
- chatbot[-1][1]=image_url = response.data[0].url
 
 
 
 
 
 
 
247
  return chatbot, "Success"
248
 
249
 
 
243
  client = OpenAI()
244
  #als Format ginge auch 'b64_json', n - Anz. der erzeugten Bilder
245
  response = client.images.generate(model="dall-e-3",prompt=prompt,size="1024x1024",quality="standard",n=1, response_format='url')
246
+ print("response")
247
+ #with open(image_path, "rb") as image_file:
248
+ #return base64.b64encode(image_file.read()).decode('utf-8')
249
+
250
+ #image = Image.open(io.BytesIO(response))
251
+ #image_64 = umwandeln_fuer_anzeige(image)
252
+ #chatbot[-1][1]= "<img src='data:image/png;base64,{0}'/>".format(base64.b64encode(image_64).decode('utf-8'))
253
+ chatbot[-1][1] = "<img src='data:image/png;base64,{0}'/>".format(response.decode('utf-8'))
254
  return chatbot, "Success"
255
 
256