alexkueck commited on
Commit
c50fbb5
1 Parent(s): b4127d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -243,14 +243,15 @@ 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
- 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
 
 
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
+ 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