Spaces:
Running
Running
Kvikontent
commited on
Commit
•
63cd697
1
Parent(s):
b36f458
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ def generate_image(payload):
|
|
29 |
response = requests.post(API_URL_IMG, headers=headers, json=payload)
|
30 |
return response.content
|
31 |
|
32 |
-
if inpt and file is not None:
|
33 |
image = Image.open(file)
|
34 |
image_bytes = io.BytesIO()
|
35 |
image.save(image_bytes, format=image.format)
|
@@ -40,7 +40,7 @@ if inpt and file is not None:
|
|
40 |
aimsg = msgs.chat_message("Assistant")
|
41 |
aimsg.write(output)
|
42 |
|
43 |
-
elif inpt and file is None:
|
44 |
output = generate_answer(inpt)
|
45 |
aimsg = msgs.chat_message("Assistant")
|
46 |
aimsg.write(output)
|
|
|
29 |
response = requests.post(API_URL_IMG, headers=headers, json=payload)
|
30 |
return response.content
|
31 |
|
32 |
+
if inpt and file is not None and not("Generate" in inpt or "Draw" in inpt or "Imagine" in inpt):
|
33 |
image = Image.open(file)
|
34 |
image_bytes = io.BytesIO()
|
35 |
image.save(image_bytes, format=image.format)
|
|
|
40 |
aimsg = msgs.chat_message("Assistant")
|
41 |
aimsg.write(output)
|
42 |
|
43 |
+
elif inpt and file is None and not("Generate" in inpt or "Draw" in inpt or "Imagine" in inpt):
|
44 |
output = generate_answer(inpt)
|
45 |
aimsg = msgs.chat_message("Assistant")
|
46 |
aimsg.write(output)
|