Views
No views yet
google/siglip2-base-patch16-256facebook/mbart-large-50-many-to-many-mmt1Image
2 -> SigLIP2 vision encoder
3 -> pooled visual feature
4 -> visual projector
5 -> visual token
6
7English phrase
8 -> mBART encoder
9
10[visual token + mBART encoder hidden states]
11 -> mBART decoder with LoRA adapters
12 -> Vietnamese translation1Image: an image containing a bicycle
2English phrase: "a man riding a bicycle"
3Output: Vietnamese translation1model_state.pt
2model_config.json
3inference.py
4tokenizer/
5image_processor/
6requirements.txt
7README.mdpip install -r requirements.txt1from inference import load_model, translate_image_phrase
2
3repo_id = "AnhDau/siglip2-mbart-envi-vlmt"
4
5model, tokenizer, image_processor, config, device = load_model(repo_id)
6
7prediction = translate_image_phrase(
8 model=model,
9 tokenizer=tokenizer,
10 image_processor=image_processor,
11 image_path="example.jpg",
12 english_phrase="a man riding a bicycle",
13 config=config,
14 device=device,
15)
16
17print(prediction)inference.py rather than directly with AutoModel.from_pretrained.