Run this model with HF Jobs
Run OpenGVLab/InternVL-14B-224px on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/OpenGVLab/InternVL-14B-224px. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OpenGVLab/InternVL-14B-224px on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use OpenGVLab/InternVL-14B-224px with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL-14B-224px with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="OpenGVLab/InternVL-14B-224px", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("OpenGVLab/InternVL-14B-224px", trust_remote_code=True) model = AutoModel.from_pretrained("OpenGVLab/InternVL-14B-224px", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files123456747 unmodified lines55565758---license: mit---```pythonimport torchfrom PIL import Image47 unmodified lines# [8.6060e-03, 9.9219e-01, 2.8759e-06],# [1.7583e-06, 3.1233e-05, 1.0000e+00]], device='cuda:0',# dtype=torch.bfloat16, grad_fn=<SoftmaxBackward0>)```1234567891011121314151617181920212223242526272829303132333447 unmodified lines828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120---license: mitdatasets:- laion/laion2B-en- laion/laion-coco- laion/laion2B-multi- kakaobrain/coyo-700m- conceptual_captions- wanng/wukong100m---# Model Card for InternVL-14B-224px## What is InternVL?\[[Paper](https://arxiv.org/abs/2312.14238)\] \[[GitHub](https://github.com/OpenGVLab/InternVL)\]InternVL scales up the ViT to _**6B parameters**_ and aligns it with LLM.It is _**the largest open-source vision/vision-language foundation model (14B)**_ to date, achieving _**32 state-of-the-art**_ performances on a wide range of tasks such as visual perception, cross-modal retrieval, multimodal dialogue, etc.## Model Details- **Model Type:** vision-language foundation model- **Model Stats:**- Params (M): 14B- Image size: 224 x 224- **Pretrain Dataset:** LAION-en, LAION-COCO, COYO, CC12M, CC3M, SBU, Wukong, LAION-multi## Model Usage```pythonimport torchfrom PIL import Image47 unmodified lines# [8.6060e-03, 9.9219e-01, 2.8759e-06],# [1.7583e-06, 3.1233e-05, 1.0000e+00]], device='cuda:0',# dtype=torch.bfloat16, grad_fn=<SoftmaxBackward0>)# please set add_eos_token to False for generationtokenizer.add_eos_token = Falseimage = Image.open('./examples/image1.jpg').convert('RGB')pixel_values = image_processor(images=image, return_tensors='pt').pixel_valuespixel_values = pixel_values.to(torch.bfloat16).cuda()tokenized = tokenizer("English caption:", return_tensors='pt')pred = model.generate(pixel_values=pixel_values,input_ids=tokenized.input_ids.cuda(),attention_mask=tokenized.attention_mask.cuda(),num_beams=5,min_new_tokens=8,)caption = tokenizer.decode(pred[0].cpu(), skip_special_tokens=True).strip()# English caption: a red panda sitting on top of a wooden platform```## CitationIf you find this project useful in your research, please consider cite:```BibTeX@article{chen2023internvl,title={InternVL: Scaling up Vision Foundation Models and Aligning for Generic Visual-Linguistic Tasks},author={Chen, Zhe and Wu, Jiannan and Wang, Wenhai and Su, Weijie and Chen, Guo and Xing, Sen and Zhong, Muyan and Zhang, Qinglong and Zhu, Xizhou and Lu, Lewei and Li, Bin and Luo, Ping and Lu, Tong and Qiao, Yu and Dai, Jifeng},journal={arXiv preprint arXiv:2312.14238},year={2023}}```## AcknowledgementInternVL is built with reference to the code of the following projects: [OpenAI CLIP](https://github.com/openai/CLIP), [Open CLIP](https://github.com/mlfoundations/open_clip), [CLIP Benchmark](https://github.com/LAION-AI/CLIP_benchmark), [EVA](https://github.com/baaivision/EVA/tree/master), [InternImage](https://github.com/OpenGVLab/InternImage), [ViT-Adapter](https://github.com/czczup/ViT-Adapter), [MMSegmentation](https://github.com/open-mmlab/mmsegmentation), [Transformers](https://github.com/huggingface/transformers), [DINOv2](https://github.com/facebookresearch/dinov2), [BLIP-2](https://github.com/salesforce/LAVIS/tree/main/projects/blip2), [Qwen-VL](https://github.com/QwenLM/Qwen-VL/tree/master/eval_mm), and [LLaVA-1.5](https://github.com/haotian-liu/LLaVA). Thanks for their awesome work!
README.md+63-1