BAAI / Bunny-v1_0-2B-zh

huggingface.co
Total runs: 201
24-hour runs: 0
7-day runs: 3
30-day runs: 58
Model's Last Updated: June 11 2024
text-generation

Introduction of Bunny-v1_0-2B-zh

Model Details of Bunny-v1_0-2B-zh

Model Card

Logo

📖 Technical report | 🏠 Code | 🐰 Demo

Bunny is a family of lightweight but powerful multimodal models. It offers multiple plug-and-play vision encoders, like EVA-CLIP, SigLIP and language backbones, including Llama-3-8B, Phi-1.5, StableLM-2, Qwen1.5, MiniCPM and Phi-2. To compensate for the decrease in model size, we construct more informative training data by curated selection from a broader data source. Remarkably, our Bunny-v1.0-3B model built upon SigLIP and Phi-2 outperforms the state-of-the-art MLLMs, not only in comparison with models of similar size but also against larger MLLM frameworks (7B), and even achieves performance on par with 13B models.

Bunny-v1.0-2B-zh employs Qwen1.5-1.8B as the language model and SigLIP as the vision encoder. The model focuses on Chinese and achieves 59.5 on MMBench-CN test split.

The model is pretrained on LAION-2M and finetuned on Bunny-695K. More details about this model can be found in GitHub .

Quickstart

Here we show a code snippet to show you how to use the model with transformers.

Before running the snippet, you need to install the following dependencies:

pip install torch transformers accelerate pillow

If the CUDA memory is enough, it would be faster to execute this snippet by setting CUDA_VISIBLE_DEVICES=0 .

Users especially those in Chinese mainland may want to refer to a HuggingFace mirror site .

import torch
import transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
from PIL import Image
import warnings

# disable some warnings
transformers.logging.set_verbosity_error()
transformers.logging.disable_progress_bar()
warnings.filterwarnings('ignore')

# set device
device = 'cuda'  # or cpu
torch.set_default_device(device)

# create model
model = AutoModelForCausalLM.from_pretrained(
    'BAAI/Bunny-v1_0-2B-zh',
    torch_dtype=torch.float16, # float32 for cpu
    device_map='auto',
    trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(
    'BAAI/Bunny-v1_0-2B-zh',
    trust_remote_code=True)

# text prompt
prompt = 'Why is the image funny?'
text = f"A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: <image>\n{prompt} ASSISTANT:"
text_chunks = [tokenizer(chunk).input_ids for chunk in text.split('<image>')]
input_ids = torch.tensor(text_chunks[0] + [-200] + text_chunks[1], dtype=torch.long).unsqueeze(0).to(device)

# image, sample images can be found in images folder
image = Image.open('example_2.png')
image_tensor = model.process_images([image], model.config).to(dtype=model.dtype, device=device)

# generate
output_ids = model.generate(
    input_ids,
    images=image_tensor,
    max_new_tokens=100,
    use_cache=True,
    repetition_penalty=1.0 # increase this to avoid chattering
)[0]

print(tokenizer.decode(output_ids[input_ids.shape[1]:], skip_special_tokens=True).strip())

License

This project utilizes certain datasets and checkpoints that are subject to their respective original licenses. Users must comply with all terms and conditions of these original licenses. The content of this project itself is licensed under the Apache license 2.0.

Runs of BAAI Bunny-v1_0-2B-zh on huggingface.co

201
Total runs
0
24-hour runs
6
3-day runs
3
7-day runs
58
30-day runs

More Information About Bunny-v1_0-2B-zh huggingface.co Model

More Bunny-v1_0-2B-zh license Visit here:

https://choosealicense.com/licenses/apache-2.0

Bunny-v1_0-2B-zh huggingface.co

Bunny-v1_0-2B-zh huggingface.co is an AI model on huggingface.co that provides Bunny-v1_0-2B-zh's model effect (), which can be used instantly with this BAAI Bunny-v1_0-2B-zh model. huggingface.co supports a free trial of the Bunny-v1_0-2B-zh model, and also provides paid use of the Bunny-v1_0-2B-zh. Support call Bunny-v1_0-2B-zh model through api, including Node.js, Python, http.

Bunny-v1_0-2B-zh huggingface.co Url

https://huggingface.co/BAAI/Bunny-v1_0-2B-zh

BAAI Bunny-v1_0-2B-zh online free

Bunny-v1_0-2B-zh huggingface.co is an online trial and call api platform, which integrates Bunny-v1_0-2B-zh's modeling effects, including api services, and provides a free online trial of Bunny-v1_0-2B-zh, you can try Bunny-v1_0-2B-zh online for free by clicking the link below.

BAAI Bunny-v1_0-2B-zh online free url in huggingface.co:

https://huggingface.co/BAAI/Bunny-v1_0-2B-zh

Bunny-v1_0-2B-zh install

Bunny-v1_0-2B-zh is an open source model from GitHub that offers a free installation service, and any user can find Bunny-v1_0-2B-zh on GitHub to install. At the same time, huggingface.co provides the effect of Bunny-v1_0-2B-zh install, users can directly use Bunny-v1_0-2B-zh installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Bunny-v1_0-2B-zh install url in huggingface.co:

https://huggingface.co/BAAI/Bunny-v1_0-2B-zh

Url of Bunny-v1_0-2B-zh

Bunny-v1_0-2B-zh huggingface.co Url

Provider of Bunny-v1_0-2B-zh huggingface.co

BAAI
ORGANIZATIONS

Other API from BAAI

huggingface.co

Total runs: 6.0M
Run Growth: 998.5K
Growth Rate: 16.62%
Updated: February 22 2024
huggingface.co

Total runs: 2.1M
Run Growth: -2.1M
Growth Rate: -98.93%
Updated: February 21 2024
huggingface.co

Total runs: 2.1M
Run Growth: -66.5K
Growth Rate: -3.12%
Updated: July 03 2024
huggingface.co

Total runs: 1.6M
Run Growth: -378.8K
Growth Rate: -23.19%
Updated: February 21 2024
huggingface.co

Total runs: 795.3K
Run Growth: 131.7K
Growth Rate: 16.58%
Updated: December 13 2023
huggingface.co

Total runs: 458.5K
Run Growth: 35.3K
Growth Rate: 7.67%
Updated: October 12 2023
huggingface.co

Total runs: 189.9K
Run Growth: 16.3K
Growth Rate: 8.56%
Updated: November 14 2023
huggingface.co

Total runs: 138.9K
Run Growth: 60.3K
Growth Rate: 43.74%
Updated: October 12 2023
huggingface.co

Total runs: 66.6K
Run Growth: -12.5K
Growth Rate: -20.56%
Updated: April 17 2024
huggingface.co

Total runs: 33.4K
Run Growth: 32.0K
Growth Rate: 95.61%
Updated: October 12 2023
huggingface.co

Total runs: 27.9K
Run Growth: 10.9K
Growth Rate: 38.64%
Updated: October 12 2023
huggingface.co

Total runs: 24.1K
Run Growth: -1.6K
Growth Rate: -6.49%
Updated: October 12 2023
huggingface.co

Total runs: 20.7K
Run Growth: -8.1K
Growth Rate: -39.09%
Updated: January 15 2025
huggingface.co

Total runs: 5.8K
Run Growth: 836
Growth Rate: 14.55%
Updated: December 26 2022
huggingface.co

Total runs: 5.1K
Run Growth: 1.2K
Growth Rate: 23.01%
Updated: September 21 2023
huggingface.co

Total runs: 5.0K
Run Growth: 491
Growth Rate: 9.79%
Updated: August 15 2024
huggingface.co

Total runs: 4.5K
Run Growth: -7.4K
Growth Rate: -165.02%
Updated: February 22 2024
huggingface.co

Total runs: 2.6K
Run Growth: 890
Growth Rate: 34.35%
Updated: August 15 2024
huggingface.co

Total runs: 2.6K
Run Growth: -287
Growth Rate: -10.48%
Updated: October 12 2023
huggingface.co

Total runs: 2.4K
Run Growth: 648
Growth Rate: 27.14%
Updated: February 07 2024
huggingface.co

Total runs: 2.3K
Run Growth: -11.8K
Growth Rate: -272.27%
Updated: October 23 2024
huggingface.co

Total runs: 1.9K
Run Growth: 744
Growth Rate: 35.94%
Updated: September 18 2023
huggingface.co

Total runs: 1.8K
Run Growth: -245
Growth Rate: -12.75%
Updated: November 28 2024
huggingface.co

Total runs: 1.4K
Run Growth: -3.5K
Growth Rate: -136.57%
Updated: October 23 2024
huggingface.co

Total runs: 1.3K
Run Growth: -3.0K
Growth Rate: -174.67%
Updated: October 24 2024
huggingface.co

Total runs: 822
Run Growth: 447
Growth Rate: 57.98%
Updated: April 02 2024
huggingface.co

Total runs: 755
Run Growth: -9.0K
Growth Rate: -1200.13%
Updated: March 07 2024
huggingface.co

Total runs: 716
Run Growth: 49
Growth Rate: 6.68%
Updated: June 07 2024
huggingface.co

Total runs: 647
Run Growth: 116
Growth Rate: 18.56%
Updated: October 27 2023
huggingface.co

Total runs: 613
Run Growth: 0
Growth Rate: 0.00%
Updated: January 15 2025
huggingface.co

Total runs: 441
Run Growth: 0
Growth Rate: 0.00%
Updated: January 14 2025
huggingface.co

Total runs: 301
Run Growth: 294
Growth Rate: 97.67%
Updated: April 18 2023
huggingface.co

Total runs: 155
Run Growth: -215
Growth Rate: -141.45%
Updated: August 15 2024
huggingface.co

Total runs: 114
Run Growth: 0
Growth Rate: 0.00%
Updated: January 20 2025
huggingface.co

Total runs: 102
Run Growth: -254
Growth Rate: -430.51%
Updated: June 24 2024
huggingface.co

Total runs: 94
Run Growth: -4
Growth Rate: -4.17%
Updated: December 21 2023
huggingface.co

Total runs: 88
Run Growth: 56
Growth Rate: 57.14%
Updated: August 23 2023
huggingface.co

Total runs: 83
Run Growth: 38
Growth Rate: 47.50%
Updated: August 15 2024
huggingface.co

Total runs: 62
Run Growth: -205
Growth Rate: -330.65%
Updated: June 21 2024
huggingface.co

Total runs: 58
Run Growth: -155
Growth Rate: -336.96%
Updated: April 19 2024
huggingface.co

Total runs: 54
Run Growth: 13
Growth Rate: 22.03%
Updated: August 23 2023
huggingface.co

Total runs: 46
Run Growth: -10
Growth Rate: -21.74%
Updated: October 27 2023
huggingface.co

Total runs: 44
Run Growth: -59
Growth Rate: -128.26%
Updated: December 21 2023
huggingface.co

Total runs: 39
Run Growth: -12
Growth Rate: -30.77%
Updated: August 15 2024
huggingface.co

Total runs: 35
Run Growth: -271
Growth Rate: -774.29%
Updated: June 24 2024
huggingface.co

Total runs: 34
Run Growth: 6
Growth Rate: 16.22%
Updated: August 28 2024
huggingface.co

Total runs: 32
Run Growth: -10.2K
Growth Rate: -28372.22%
Updated: February 07 2024
huggingface.co

Total runs: 29
Run Growth: 0
Growth Rate: 0.00%
Updated: January 01 2025
huggingface.co

Total runs: 26
Run Growth: 12
Growth Rate: 46.15%
Updated: July 24 2023
huggingface.co

Total runs: 21
Run Growth: -56
Growth Rate: -266.67%
Updated: December 31 2022
huggingface.co

Total runs: 17
Run Growth: -109
Growth Rate: -641.18%
Updated: May 13 2024
huggingface.co

Total runs: 16
Run Growth: -24
Growth Rate: -150.00%
Updated: July 02 2024