Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,8 +63,8 @@ def caption_random_image():
|
|
| 63 |
caption_eng = processor.decode(out[0], skip_special_tokens=True)
|
| 64 |
|
| 65 |
# Translate caption from English to Spanish
|
| 66 |
-
trans_inputs = trans_tokenizer.encode(
|
| 67 |
-
trans_out = trans_model.generate(
|
| 68 |
caption_es = trans_tokenizer.decode(trans_out[0], skip_special_tokens=True)
|
| 69 |
|
| 70 |
return image, caption_eng, caption_es
|
|
|
|
| 63 |
caption_eng = processor.decode(out[0], skip_special_tokens=True)
|
| 64 |
|
| 65 |
# Translate caption from English to Spanish
|
| 66 |
+
trans_inputs = trans_tokenizer.encode(caption_eng, return_tensors="pt")
|
| 67 |
+
trans_out = trans_model.generate(trans_inputs)
|
| 68 |
caption_es = trans_tokenizer.decode(trans_out[0], skip_special_tokens=True)
|
| 69 |
|
| 70 |
return image, caption_eng, caption_es
|