Kvikontent commited on
Commit
a397059
1 Parent(s): 768ed43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,7 +32,7 @@ def generate_image(payload):
32
  return response.content
33
 
34
  if inpt and file is not None:
35
- imgp = blip_query(file)
36
  pp = "Generate answer on this question: " + inpt + ". Use this image description to give answer: " + imgp[0]['generated_text']
37
  output = generate_answer(pp)
38
  aimsg = msgs.chat_message("Assistant")
@@ -44,8 +44,8 @@ elif inpt and file is None:
44
  aimsg.write(output)
45
 
46
  elif inpt and ("Generate" in inpt or "Draw" in inpt or "Imagine" in inpt):
47
- prompt = inpt.split("--")[1]
48
- output = generate_image(prompt)
49
  if output:
50
  aimsg = msgs.chat_message("Assistant")
51
  aimsg.write("Image generated successfully!")
 
32
  return response.content
33
 
34
  if inpt and file is not None:
35
+ imgp = blip_query(file.read())
36
  pp = "Generate answer on this question: " + inpt + ". Use this image description to give answer: " + imgp[0]['generated_text']
37
  output = generate_answer(pp)
38
  aimsg = msgs.chat_message("Assistant")
 
44
  aimsg.write(output)
45
 
46
  elif inpt and ("Generate" in inpt or "Draw" in inpt or "Imagine" in inpt):
47
+ payload = {"prompts": prompt}
48
+ output = generate_image(payload)
49
  if output:
50
  aimsg = msgs.chat_message("Assistant")
51
  aimsg.write("Image generated successfully!")