Image-Text-to-Text
Transformers
Safetensors
English
gemma3n
text-generation-inference
unsloth
trl
conversational
Instructions to use czagnos/gemma3n-bite-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use czagnos/gemma3n-bite-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="czagnos/gemma3n-bite-classifier", device_map="auto") messages = [ { "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?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("czagnos/gemma3n-bite-classifier") model = AutoModelForMultimodalLM.from_pretrained("czagnos/gemma3n-bite-classifier", device_map="auto") messages = [ { "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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use czagnos/gemma3n-bite-classifier with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "czagnos/gemma3n-bite-classifier" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "czagnos/gemma3n-bite-classifier", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/czagnos/gemma3n-bite-classifier
- SGLang
How to use czagnos/gemma3n-bite-classifier with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "czagnos/gemma3n-bite-classifier" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "czagnos/gemma3n-bite-classifier", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "czagnos/gemma3n-bite-classifier" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "czagnos/gemma3n-bite-classifier", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Unsloth Studio
How to use czagnos/gemma3n-bite-classifier with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for czagnos/gemma3n-bite-classifier to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for czagnos/gemma3n-bite-classifier to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for czagnos/gemma3n-bite-classifier to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="czagnos/gemma3n-bite-classifier", max_seq_length=2048, ) - Docker Model Runner
How to use czagnos/gemma3n-bite-classifier with Docker Model Runner:
docker model run hf.co/czagnos/gemma3n-bite-classifier
Merged (LoRA+base) Gemma3N model (Trained with Unsloth)
Browse files- config.json +0 -12
- model-00001-of-00003.safetensors +2 -2
- model-00002-of-00003.safetensors +2 -2
- model-00003-of-00003.safetensors +2 -2
- model.safetensors.index.json +0 -0
config.json
CHANGED
|
@@ -58,18 +58,6 @@
|
|
| 58 |
"initializer_range": 0.02,
|
| 59 |
"model_type": "gemma3n",
|
| 60 |
"pad_token_id": 0,
|
| 61 |
-
"quantization_config": {
|
| 62 |
-
"bnb_4bit_compute_dtype": "float16",
|
| 63 |
-
"bnb_4bit_quant_type": "nf4",
|
| 64 |
-
"bnb_4bit_use_double_quant": true,
|
| 65 |
-
"llm_int8_enable_fp32_cpu_offload": false,
|
| 66 |
-
"llm_int8_has_fp16_weight": false,
|
| 67 |
-
"llm_int8_skip_modules": null,
|
| 68 |
-
"llm_int8_threshold": 6.0,
|
| 69 |
-
"load_in_4bit": true,
|
| 70 |
-
"load_in_8bit": false,
|
| 71 |
-
"quant_method": "bitsandbytes"
|
| 72 |
-
},
|
| 73 |
"text_config": {
|
| 74 |
"activation_sparsity_pattern": [
|
| 75 |
0.95,
|
|
|
|
| 58 |
"initializer_range": 0.02,
|
| 59 |
"model_type": "gemma3n",
|
| 60 |
"pad_token_id": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
"text_config": {
|
| 62 |
"activation_sparsity_pattern": [
|
| 63 |
0.95,
|
model-00001-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:385b1e02fcb424cfcf62e56014ec9fd6cea58271ecdc32e2252052d0b7159636
|
| 3 |
+
size 4983255024
|
model-00002-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:914041add7d8225f8eb2e055075660c32e55f16bef1fc2d8e0c5a048be5ebf79
|
| 3 |
+
size 4992753872
|
model-00003-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:80696829ba5a9fb9a815ad093725d3cb5ddaf9ed023bbbca197770a8210ce5ff
|
| 3 |
+
size 903075560
|
model.safetensors.index.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|