Spaces:
Running
on
Zero
Running
on
Zero
fancyfeast
commited on
Commit
·
2fb293b
1
Parent(s):
5d57e40
Dorp
Browse files
app.py
CHANGED
|
@@ -147,6 +147,12 @@ def stream_chat(input_image: Image.Image, caption_type: str, caption_tone: str,
|
|
| 147 |
# 'any' means no length specified
|
| 148 |
length = None if caption_length == "any" else caption_length
|
| 149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
# 'rng-tags' and 'training_prompt' don't have formal/informal tones
|
| 151 |
if caption_type == "rng-tags" or caption_type == "training_prompt":
|
| 152 |
caption_tone = "formal"
|
|
|
|
| 147 |
# 'any' means no length specified
|
| 148 |
length = None if caption_length == "any" else caption_length
|
| 149 |
|
| 150 |
+
if isinstance(length, str):
|
| 151 |
+
try:
|
| 152 |
+
length = int(length)
|
| 153 |
+
except ValueError:
|
| 154 |
+
pass
|
| 155 |
+
|
| 156 |
# 'rng-tags' and 'training_prompt' don't have formal/informal tones
|
| 157 |
if caption_type == "rng-tags" or caption_type == "training_prompt":
|
| 158 |
caption_tone = "formal"
|