Commit
·
5ab8f78
1
Parent(s):
34ba17e
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ checkpoint2 = "wangjin2000/git-base-finetune"
|
|
| 16 |
model2 = AutoModelForCausalLM.from_pretrained(checkpoint2)
|
| 17 |
|
| 18 |
#en_zh_translator = pipeline("translation",model="Helsinki-NLP/opus-mt-en-zh")
|
| 19 |
-
en_zh_translator = pipeline("translation",model="
|
| 20 |
|
| 21 |
def img2cap_com(image):
|
| 22 |
input1 = processor(images=image, return_tensors="pt").to(device)
|
|
|
|
| 16 |
model2 = AutoModelForCausalLM.from_pretrained(checkpoint2)
|
| 17 |
|
| 18 |
#en_zh_translator = pipeline("translation",model="Helsinki-NLP/opus-mt-en-zh")
|
| 19 |
+
en_zh_translator = pipeline("translation",model="t5-base", src_lang = 'en', tgt_lang = 'zh')
|
| 20 |
|
| 21 |
def img2cap_com(image):
|
| 22 |
input1 = processor(images=image, return_tensors="pt").to(device)
|