alexkueck commited on
Commit
e4f13f0
1 Parent(s): 5aa4d07

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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.content
399
- image = Image.open(io.BytesIO(result))
400
- history[-1][1] = image
 
 
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"