yujiepan / gemma-3-tiny-random

huggingface.co
Total runs: 3.7K
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: March 16 2025
image-text-to-text

Introduction of gemma-3-tiny-random

Model Details of gemma-3-tiny-random

This tiny model is for debugging. It is randomly initialized with the config adapted from google/gemma-3-27b-it .

Example usage:
from transformers import pipeline
model_id = "yujiepan/gemma-3-tiny-random"
pipe = pipeline(
    "image-text-to-text", model=model_id, device="cuda",
    trust_remote_code=True, max_new_tokens=3,
)
messages = [
    {
        "role": "system",
        "content": [{"type": "text", "text": "You are a helpful assistant."}]
    },
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
            {"type": "text", "text": "What animal is on the candy?"}
        ]
    }
]
output = pipe(text=messages, max_new_tokens=5)
print(output)
Codes to create this repo:
import torch

from transformers import (
    AutoConfig,
    AutoModelForCausalLM,
    AutoProcessor,
    AutoTokenizer,
    Gemma3ForConditionalGeneration,
    GenerationConfig,
    pipeline,
    set_seed,
)

source_model_id = "google/gemma-3-27b-it"
save_folder = "/tmp/yujiepan/gemma-3-tiny-random"

processor = AutoProcessor.from_pretrained(
    source_model_id, trust_remote_code=True,
)
processor.save_pretrained(save_folder)

config = AutoConfig.from_pretrained(
    source_model_id, trust_remote_code=True,
)
config.text_config.hidden_size = 32
config.text_config.intermediate_size = 128
config.text_config.head_dim = 32
config.text_config.num_attention_heads = 1
config.text_config.num_key_value_heads = 1
config.text_config.num_hidden_layers = 2
config.text_config.sliding_window_pattern = 2
config.vision_config.hidden_size = 32
config.vision_config.num_hidden_layers = 2
config.vision_config.num_attention_heads = 1
config.vision_config.intermediate_size = 128
model = Gemma3ForConditionalGeneration(
    config,
).to(torch.bfloat16)
for layer in model.language_model.model.layers:
    print(layer.is_sliding)
model.generation_config = GenerationConfig.from_pretrained(
    source_model_id, trust_remote_code=True,
)
set_seed(42)
with torch.no_grad():
    for name, p in sorted(model.named_parameters()):
        torch.nn.init.normal_(p, 0, 0.5)
        print(name, p.shape)
model.save_pretrained(save_folder)

Runs of yujiepan gemma-3-tiny-random on huggingface.co

3.7K
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About gemma-3-tiny-random huggingface.co Model

gemma-3-tiny-random huggingface.co

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

gemma-3-tiny-random huggingface.co Url

https://huggingface.co/yujiepan/gemma-3-tiny-random

yujiepan gemma-3-tiny-random online free

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

yujiepan gemma-3-tiny-random online free url in huggingface.co:

https://huggingface.co/yujiepan/gemma-3-tiny-random

gemma-3-tiny-random install

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

gemma-3-tiny-random install url in huggingface.co:

https://huggingface.co/yujiepan/gemma-3-tiny-random

Url of gemma-3-tiny-random

gemma-3-tiny-random huggingface.co Url

Provider of gemma-3-tiny-random huggingface.co

yujiepan
ORGANIZATIONS

Other API from yujiepan