Uploaded model

  • Developed by: lottery7
  • License: apache-2.0
  • Finetuned from model : unsloth/gemma-3n-e4b-it-unsloth-bnb-4bit

This gemma3n model was trained 2x faster with Unsloth and Huggingface's TRL library.

Usage

from unsloth import FastModel
from datasets import load_dataset,Audio,concatenate_datasets
from transformers import TextStreamer

def do_gemma_3n_inference(messages, max_new_tokens = 128):
    _ = model.generate(
        **processor.apply_chat_template(
            messages,
            add_generation_prompt = True, # Must add for generation
            tokenize = True,
            return_dict = True,
            return_tensors = "pt",
        ).to("cuda"),
        max_new_tokens = max_new_tokens,
        do_sample=False,
        streamer = TextStreamer(processor, skip_prompt = True),
    )

model, processor = FastModel.from_pretrained(
    model_name = "lottery7/gemma-3n-e4b-fleurs-ru-lora", # YOUR MODEL YOU USED FOR TRAINING
    max_seq_length = 2048,
    load_in_4bit = True,
)


dataset = load_dataset("google/fleurs", "ru_ru", split="train")

test_audio = dataset[2]

messages = [
    {
        "role": "system",
        "content": [
            {
                "type": "text",
                "text": "You are an assistant that transcribes speech accurately.",
            }
        ],
    },
    {
        "role": "user",
        "content": [
            {"type": "audio", "audio": test_audio['audio']['array']},
            {"type": "text", "text": "Please transcribe this audio."}
        ]
    }
]

do_gemma_3n_inference(messages, max_new_tokens = 256)
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support