Spaces:
Runtime error
Runtime error
Update app.py
#1
by
Futuretop
- opened
app.py
CHANGED
|
@@ -23,6 +23,10 @@ def generate_caption(image):
|
|
| 23 |
output_ids = model.generate(**inputs, max_length=50)
|
| 24 |
caption = processor.decode(output_ids[0], skip_special_tokens=True)
|
| 25 |
print("β
μμ±λ μ€λͺ
:", caption)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
return caption
|
| 27 |
|
| 28 |
# 4. Gradio μΈν°νμ΄μ€ ꡬμ±
|
|
|
|
| 23 |
output_ids = model.generate(**inputs, max_length=50)
|
| 24 |
caption = processor.decode(output_ids[0], skip_special_tokens=True)
|
| 25 |
print("β
μμ±λ μ€λͺ
:", caption)
|
| 26 |
+
if "Asian" in caption:
|
| 27 |
+
caption = caption.replace("Asian", "Korean")
|
| 28 |
+
print("β
μμ±λ μ€λͺ
:", caption)
|
| 29 |
+
return caption
|
| 30 |
return caption
|
| 31 |
|
| 32 |
# 4. Gradio μΈν°νμ΄μ€ ꡬμ±
|