alexkueck commited on
Commit
2e09900
1 Parent(s): 197f67d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -393,14 +393,11 @@ def invoke (prompt, file, history, rag_option, model_option, openai_api_key, k=3
393
  if (prompt.find('Bild zeichnen') != -1):
394
  #print("OpenAI zeichnen.......................")
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
- data = {'prompt': prompt, 'guidance_scale': scale}
398
  response = requests.post(API_URL, headers=HEADERS, json=data)
399
- result = response.json()["images"][0]
400
- image_b64 = (f"data:image/jpeg;base64,{result}")
401
- #result = response.content
402
- #image = Image.open(io.BytesIO(result))
403
- history[-1][1] = image_b64
404
  print("history......................")
405
  print(history)
406
  return history, "Stop: Success"
 
393
  if (prompt.find('Bild zeichnen') != -1):
394
  #print("OpenAI zeichnen.......................")
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] = file #image
 
 
401
  print("history......................")
402
  print(history)
403
  return history, "Stop: Success"