BAAI / Bunny-v1_1-4B

huggingface.co
Total runs: 52
24-hour runs: 21
7-day runs: -40
30-day runs: -243
Model's Last Updated: June 24 2024
text-generation

Introduction of Bunny-v1_1-4B

Model Details of Bunny-v1_1-4B

Model Card

Logo

📖 Technical report | 🏠 Code | 🐰 Demo

This is Bunny-v1.1-4B.

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.1-4B, which is built upon SigLIP and Phi-3-mini-4k-instruct with S 2 ^{2} -Wrapper , supporting 1152x1152 resolution. 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_1-4B',
    torch_dtype=torch.float16, # float32 for cpu
    device_map='auto',
    trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(
    'BAAI/Bunny-v1_1-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_1-4B on huggingface.co

52
Total runs
21
24-hour runs
15
3-day runs
-40
7-day runs
-243
30-day runs

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

More Bunny-v1_1-4B license Visit here:

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

Bunny-v1_1-4B huggingface.co

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

Bunny-v1_1-4B huggingface.co Url

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

BAAI Bunny-v1_1-4B online free

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

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

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

Bunny-v1_1-4B install

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

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

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

Url of Bunny-v1_1-4B

Bunny-v1_1-4B huggingface.co Url

Provider of Bunny-v1_1-4B huggingface.co

BAAI
ORGANIZATIONS

Other API from BAAI

huggingface.co

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

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

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

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

Total runs: 781.8K
Run Growth: 150.9K
Growth Rate: 18.90%
Updated: December 13 2023
huggingface.co

Total runs: 449.9K
Run Growth: 26.8K
Growth Rate: 5.89%
Updated: October 12 2023
huggingface.co

Total runs: 192.5K
Run Growth: 19.9K
Growth Rate: 10.13%
Updated: November 14 2023
huggingface.co

Total runs: 137.3K
Run Growth: 67.1K
Growth Rate: 48.53%
Updated: October 12 2023
huggingface.co

Total runs: 52.6K
Run Growth: -28.8K
Growth Rate: -64.27%
Updated: April 17 2024
huggingface.co

Total runs: 33.5K
Run Growth: 32.2K
Growth Rate: 95.90%
Updated: October 12 2023
huggingface.co

Total runs: 28.0K
Run Growth: 11.3K
Growth Rate: 40.01%
Updated: October 12 2023
huggingface.co

Total runs: 24.9K
Run Growth: -1.4K
Growth Rate: -5.38%
Updated: October 12 2023
huggingface.co

Total runs: 20.5K
Run Growth: -12.0K
Growth Rate: -59.24%
Updated: January 15 2025
huggingface.co

Total runs: 5.6K
Run Growth: 419
Growth Rate: 7.87%
Updated: December 26 2022
huggingface.co

Total runs: 5.0K
Run Growth: 1.0K
Growth Rate: 20.73%
Updated: September 21 2023
huggingface.co

Total runs: 4.9K
Run Growth: 241
Growth Rate: 4.84%
Updated: August 15 2024
huggingface.co

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

Total runs: 2.7K
Run Growth: -491
Growth Rate: -17.93%
Updated: October 12 2023
huggingface.co

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

Total runs: 2.5K
Run Growth: 685
Growth Rate: 27.91%
Updated: August 15 2024
huggingface.co

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

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

Total runs: 1.9K
Run Growth: -276
Growth Rate: -14.18%
Updated: November 28 2024
huggingface.co

Total runs: 1.5K
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: 747
Run Growth: 141
Growth Rate: 17.83%
Updated: June 07 2024
huggingface.co

Total runs: 732
Run Growth: -9.2K
Growth Rate: -1272.69%
Updated: March 07 2024
huggingface.co

Total runs: 637
Run Growth: 314
Growth Rate: 49.22%
Updated: April 02 2024
huggingface.co

Total runs: 615
Run Growth: 69
Growth Rate: 11.52%
Updated: October 27 2023
huggingface.co

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

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

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

Total runs: 218
Run Growth: -12
Growth Rate: -5.50%
Updated: October 29 2023
huggingface.co

Total runs: 146
Run Growth: -244
Growth Rate: -171.83%
Updated: August 15 2024
huggingface.co

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

Total runs: 96
Run Growth: 48
Growth Rate: 51.06%
Updated: August 23 2023
huggingface.co

Total runs: 96
Run Growth: 17
Growth Rate: 18.09%
Updated: December 21 2023
huggingface.co

Total runs: 84
Run Growth: 54
Growth Rate: 60.00%
Updated: August 15 2024
huggingface.co

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

Total runs: 64
Run Growth: -244
Growth Rate: -369.70%
Updated: June 21 2024
huggingface.co

Total runs: 47
Run Growth: -25
Growth Rate: -53.19%
Updated: October 27 2023
huggingface.co

Total runs: 46
Run Growth: -57
Growth Rate: -116.33%
Updated: December 21 2023
huggingface.co

Total runs: 46
Run Growth: -170
Growth Rate: -548.39%
Updated: April 19 2024
huggingface.co

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

Total runs: 37
Run Growth: 6
Growth Rate: 15.38%
Updated: August 28 2024
huggingface.co

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

Total runs: 34
Run Growth: -273
Growth Rate: -827.27%
Updated: June 24 2024
huggingface.co

Total runs: 26
Run Growth: 10
Growth Rate: 38.46%
Updated: July 24 2023
huggingface.co

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

Total runs: 18
Run Growth: -107
Growth Rate: -594.44%
Updated: May 13 2024
huggingface.co

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

Total runs: 15
Run Growth: -18
Growth Rate: -112.50%
Updated: December 25 2023