BAAI / Bunny-v1_0-4B

huggingface.co
Total runs: 34
24-hour runs: -5
7-day runs: -2
30-day runs: -227
Model's Last Updated: June 24 2024
text-generation

Introduction of Bunny-v1_0-4B

Model Details of Bunny-v1_0-4B

Model Card

Logo

📖 Technical report | 🏠 Code | 🐰 Demo | 🤗 GGUF

This is Bunny-v1.0-4B.

We also provide v1.1 version accepting high-resolution images up to 1152x1152. 🤗 v1.1

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 Phi-3-mini, Llama-3-8B, Phi-1.5, StableLM-2 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.

We provide Bunny-v1.0-4B, which is built upon SigLIP and Phi-3-Mini-4K-Instruct . More details about this model can be found in GitHub .

comparison

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-4B',
    torch_dtype=torch.float16, # float32 for cpu
    device_map='auto',
    trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(
    'BAAI/Bunny-v1_0-4B',
    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][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())

Runs of BAAI Bunny-v1_0-4B on huggingface.co

34
Total runs
-5
24-hour runs
-3
3-day runs
-2
7-day runs
-227
30-day runs

More Information About Bunny-v1_0-4B huggingface.co Model

More Bunny-v1_0-4B license Visit here:

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

Bunny-v1_0-4B huggingface.co

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

Bunny-v1_0-4B huggingface.co Url

https://huggingface.co/BAAI/Bunny-v1_0-4B

BAAI Bunny-v1_0-4B online free

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

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

https://huggingface.co/BAAI/Bunny-v1_0-4B

Bunny-v1_0-4B install

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

Bunny-v1_0-4B install url in huggingface.co:

https://huggingface.co/BAAI/Bunny-v1_0-4B

Url of Bunny-v1_0-4B

Bunny-v1_0-4B huggingface.co Url

Provider of Bunny-v1_0-4B huggingface.co

BAAI
ORGANIZATIONS

Other API from BAAI

huggingface.co

Total runs: 2.2M
Run Growth: -2.3M
Growth Rate: -114.09%
Updated: February 21 2024
huggingface.co

Total runs: 2.1M
Run Growth: 2.6K
Growth Rate: 0.12%
Updated: July 03 2024
huggingface.co

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

Total runs: 954.2K
Run Growth: 640.3K
Growth Rate: 65.68%
Updated: April 02 2024
huggingface.co

Total runs: 759.4K
Run Growth: 148.9K
Growth Rate: 19.54%
Updated: December 13 2023
huggingface.co

Total runs: 463.7K
Run Growth: 67.2K
Growth Rate: 14.33%
Updated: October 12 2023
huggingface.co

Total runs: 152.3K
Run Growth: -20.8K
Growth Rate: -13.29%
Updated: November 14 2023
huggingface.co

Total runs: 139.5K
Run Growth: 45.3K
Growth Rate: 32.49%
Updated: October 12 2023
huggingface.co

Total runs: 67.5K
Run Growth: 4.7K
Growth Rate: 6.79%
Updated: April 17 2024
huggingface.co

Total runs: 32.6K
Run Growth: 30.9K
Growth Rate: 94.39%
Updated: October 12 2023
huggingface.co

Total runs: 27.2K
Run Growth: 10.1K
Growth Rate: 37.67%
Updated: October 12 2023
huggingface.co

Total runs: 20.8K
Run Growth: 2.8K
Growth Rate: 12.60%
Updated: January 15 2025
huggingface.co

Total runs: 5.5K
Run Growth: -1.3K
Growth Rate: -25.42%
Updated: February 22 2024
huggingface.co

Total runs: 5.2K
Run Growth: 1.5K
Growth Rate: 29.02%
Updated: September 21 2023
huggingface.co

Total runs: 5.1K
Run Growth: 1.3K
Growth Rate: 24.23%
Updated: August 15 2024
huggingface.co

Total runs: 3.4K
Run Growth: -3.6K
Growth Rate: -108.35%
Updated: December 26 2022
huggingface.co

Total runs: 3.2K
Run Growth: 340
Growth Rate: 10.88%
Updated: October 12 2023
huggingface.co

Total runs: 2.9K
Run Growth: 1.3K
Growth Rate: 44.20%
Updated: August 15 2024
huggingface.co

Total runs: 2.3K
Run Growth: 982
Growth Rate: 41.17%
Updated: February 07 2024
huggingface.co

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

Total runs: 1.8K
Run Growth: 375
Growth Rate: 20.89%
Updated: September 18 2023
huggingface.co

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

Total runs: 1.5K
Run Growth: -375
Growth Rate: -24.87%
Updated: November 28 2024
huggingface.co

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

Total runs: 1.0K
Run Growth: 865
Growth Rate: 85.47%
Updated: April 02 2024
huggingface.co

Total runs: 734
Run Growth: 341
Growth Rate: 46.46%
Updated: October 27 2023
huggingface.co

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

Total runs: 708
Run Growth: -2.9K
Growth Rate: -436.50%
Updated: March 07 2024
huggingface.co

Total runs: 571
Run Growth: -80
Growth Rate: -13.45%
Updated: June 07 2024
huggingface.co

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

Total runs: 324
Run Growth: 301
Growth Rate: 99.34%
Updated: April 18 2023
huggingface.co

Total runs: 153
Run Growth: -119
Growth Rate: -78.29%
Updated: August 15 2024
huggingface.co

Total runs: 145
Run Growth: 25
Growth Rate: 17.24%
Updated: June 24 2024
huggingface.co

Total runs: 118
Run Growth: 78
Growth Rate: 66.67%
Updated: August 23 2023
huggingface.co

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

Total runs: 104
Run Growth: -65
Growth Rate: -62.50%
Updated: April 19 2024
huggingface.co

Total runs: 96
Run Growth: 8
Growth Rate: 8.42%
Updated: December 21 2023
huggingface.co

Total runs: 87
Run Growth: 56
Growth Rate: 64.37%
Updated: August 23 2023
huggingface.co

Total runs: 58
Run Growth: -179
Growth Rate: -298.33%
Updated: June 21 2024
huggingface.co

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

Total runs: 34
Run Growth: -28
Growth Rate: -82.35%
Updated: August 15 2024
huggingface.co

Total runs: 33
Run Growth: -61
Growth Rate: -184.85%
Updated: August 15 2024
huggingface.co

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

Total runs: 30
Run Growth: 18
Growth Rate: 64.29%
Updated: July 24 2023
huggingface.co

Total runs: 29
Run Growth: -41
Growth Rate: -141.38%
Updated: December 31 2022
huggingface.co

Total runs: 27
Run Growth: -4.2K
Growth Rate: -16792.00%
Updated: February 07 2024
huggingface.co

Total runs: 26
Run Growth: -18
Growth Rate: -69.23%
Updated: August 28 2024
huggingface.co

Total runs: 19
Run Growth: -103
Growth Rate: -542.11%
Updated: May 13 2024
huggingface.co

Total runs: 17
Run Growth: -19
Growth Rate: -111.76%
Updated: July 02 2024
huggingface.co

Total runs: 16
Run Growth: -41
Growth Rate: -256.25%
Updated: May 31 2024