Text Generation
Transformers
Safetensors
Indonesian
English
gemma3n
image-text-to-text
gemma
gemma-3n
unsloth
lora
fine-tuned
indonesian
english
conversational
Instructions to use OpenPathAI/Orbit-4-Gemma-E4B-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenPathAI/Orbit-4-Gemma-E4B-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenPathAI/Orbit-4-Gemma-E4B-it") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("OpenPathAI/Orbit-4-Gemma-E4B-it") model = AutoModelForMultimodalLM.from_pretrained("OpenPathAI/Orbit-4-Gemma-E4B-it", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenPathAI/Orbit-4-Gemma-E4B-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenPathAI/Orbit-4-Gemma-E4B-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenPathAI/Orbit-4-Gemma-E4B-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OpenPathAI/Orbit-4-Gemma-E4B-it
- SGLang
How to use OpenPathAI/Orbit-4-Gemma-E4B-it 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 "OpenPathAI/Orbit-4-Gemma-E4B-it" \ --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": "OpenPathAI/Orbit-4-Gemma-E4B-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "OpenPathAI/Orbit-4-Gemma-E4B-it" \ --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": "OpenPathAI/Orbit-4-Gemma-E4B-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use OpenPathAI/Orbit-4-Gemma-E4B-it with Docker Model Runner:
docker model run hf.co/OpenPathAI/Orbit-4-Gemma-E4B-it
Download checkpoints/checkpoint-500/trainer_state.json from OpenPathAI/Orbit-4-Gemma-E4B-it: direct link, hf CLI and curl.
- Browser
- Download file 9.79 kB
-
https://huggingface.co/OpenPathAI/Orbit-4-Gemma-E4B-it/resolve/main/checkpoints/checkpoint-500/trainer_state.json
- Command line
-
hf download hf://OpenPathAI/Orbit-4-Gemma-E4B-it/checkpoints/checkpoint-500/trainer_state.json
-
curl -L -o trainer_state.json https://huggingface.co/OpenPathAI/Orbit-4-Gemma-E4B-it/resolve/main/checkpoints/checkpoint-500/trainer_state.json
9.79 kB
Invalid JSON:Unexpected token 'N', ..."ad_norm": NaN,
"... is not valid JSON
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 0.016774583151608683, | |
| "eval_steps": 500, | |
| "global_step": 500, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.00033549166303217364, | |
| "grad_norm": 3.6124119758605957, | |
| "learning_rate": 2.011173184357542e-06, | |
| "loss": 2.9620466232299805, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.0006709833260643473, | |
| "grad_norm": 0.8180733323097229, | |
| "learning_rate": 4.245810055865922e-06, | |
| "loss": 2.254135513305664, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.0010064749890965209, | |
| "grad_norm": 1.8416152000427246, | |
| "learning_rate": 6.4804469273743025e-06, | |
| "loss": 2.308770179748535, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.0013419666521286946, | |
| "grad_norm": 1.6899038553237915, | |
| "learning_rate": 8.715083798882683e-06, | |
| "loss": 2.354534149169922, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.0016774583151608683, | |
| "grad_norm": 1.0635626316070557, | |
| "learning_rate": 1.0949720670391061e-05, | |
| "loss": 1.9643959045410155, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.0020129499781930417, | |
| "grad_norm": 1.7144725322723389, | |
| "learning_rate": 1.3184357541899443e-05, | |
| "loss": 2.196229934692383, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.0023484416412252154, | |
| "grad_norm": 2.0055930614471436, | |
| "learning_rate": 1.5418994413407823e-05, | |
| "loss": 1.9873594284057616, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.002683933304257389, | |
| "grad_norm": 1.3090643882751465, | |
| "learning_rate": 1.7653631284916203e-05, | |
| "loss": 1.7420753479003905, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.003019424967289563, | |
| "grad_norm": 0.6108576655387878, | |
| "learning_rate": 1.9888268156424583e-05, | |
| "loss": 1.8236627578735352, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.0033549166303217365, | |
| "grad_norm": 0.6574695706367493, | |
| "learning_rate": 2.212290502793296e-05, | |
| "loss": 1.7359764099121093, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.0036904082933539102, | |
| "grad_norm": 0.8230994939804077, | |
| "learning_rate": 2.4357541899441343e-05, | |
| "loss": 1.5833864212036133, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 0.0040258999563860835, | |
| "grad_norm": 0.9543447494506836, | |
| "learning_rate": 2.6592178770949723e-05, | |
| "loss": 1.51551513671875, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.004361391619418257, | |
| "grad_norm": 0.9667573571205139, | |
| "learning_rate": 2.88268156424581e-05, | |
| "loss": 1.4613374710083007, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 0.004696883282450431, | |
| "grad_norm": 1.9220093488693237, | |
| "learning_rate": 3.106145251396648e-05, | |
| "loss": 1.5392029762268067, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 0.005032374945482605, | |
| "grad_norm": 0.7170810699462891, | |
| "learning_rate": 3.329608938547486e-05, | |
| "loss": 1.5076921463012696, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.005367866608514778, | |
| "grad_norm": 0.8078820705413818, | |
| "learning_rate": 3.553072625698324e-05, | |
| "loss": 1.7222694396972655, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 0.005703358271546952, | |
| "grad_norm": 0.809903085231781, | |
| "learning_rate": 3.776536312849162e-05, | |
| "loss": 1.8752283096313476, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 0.006038849934579126, | |
| "grad_norm": 0.7261088490486145, | |
| "learning_rate": 4e-05, | |
| "loss": 1.3927306175231933, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 0.006374341597611299, | |
| "grad_norm": 1.5483784675598145, | |
| "learning_rate": 4.223463687150838e-05, | |
| "loss": 1.4321404457092286, | |
| "step": 190 | |
| }, | |
| { | |
| "epoch": 0.006709833260643473, | |
| "grad_norm": 0.7559241056442261, | |
| "learning_rate": 4.4469273743016757e-05, | |
| "loss": 1.325460147857666, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.007045324923675647, | |
| "grad_norm": 1.563735008239746, | |
| "learning_rate": 4.670391061452514e-05, | |
| "loss": 1.372646427154541, | |
| "step": 210 | |
| }, | |
| { | |
| "epoch": 0.0073808165867078205, | |
| "grad_norm": 0.752616822719574, | |
| "learning_rate": 4.8938547486033523e-05, | |
| "loss": 1.1150728225708009, | |
| "step": 220 | |
| }, | |
| { | |
| "epoch": 0.007716308249739994, | |
| "grad_norm": 0.8065235614776611, | |
| "learning_rate": 5.11731843575419e-05, | |
| "loss": 1.1660142898559571, | |
| "step": 230 | |
| }, | |
| { | |
| "epoch": 0.008051799912772167, | |
| "grad_norm": 0.9588292241096497, | |
| "learning_rate": 5.3407821229050284e-05, | |
| "loss": 1.1108501434326172, | |
| "step": 240 | |
| }, | |
| { | |
| "epoch": 0.008387291575804342, | |
| "grad_norm": 0.8693965077400208, | |
| "learning_rate": 5.564245810055866e-05, | |
| "loss": 1.4471724510192872, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 0.008722783238836514, | |
| "grad_norm": 2.0879530906677246, | |
| "learning_rate": 5.787709497206704e-05, | |
| "loss": 1.2001781463623047, | |
| "step": 260 | |
| }, | |
| { | |
| "epoch": 0.009058274901868689, | |
| "grad_norm": 0.8522306084632874, | |
| "learning_rate": 6.011173184357543e-05, | |
| "loss": 1.363035297393799, | |
| "step": 270 | |
| }, | |
| { | |
| "epoch": 0.009393766564900862, | |
| "grad_norm": 1.0152027606964111, | |
| "learning_rate": 6.23463687150838e-05, | |
| "loss": 1.2856069564819337, | |
| "step": 280 | |
| }, | |
| { | |
| "epoch": 0.009729258227933036, | |
| "grad_norm": NaN, | |
| "learning_rate": 6.458100558659218e-05, | |
| "loss": 2.133226013183594, | |
| "step": 290 | |
| }, | |
| { | |
| "epoch": 0.01006474989096521, | |
| "grad_norm": NaN, | |
| "learning_rate": 6.681564245810056e-05, | |
| "loss": 5.05937385559082, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 0.010400241553997384, | |
| "grad_norm": NaN, | |
| "learning_rate": 6.905027932960895e-05, | |
| "loss": 4.477165985107422, | |
| "step": 310 | |
| }, | |
| { | |
| "epoch": 0.010735733217029557, | |
| "grad_norm": 3.5620813369750977, | |
| "learning_rate": 7.128491620111732e-05, | |
| "loss": 2.7552057266235352, | |
| "step": 320 | |
| }, | |
| { | |
| "epoch": 0.011071224880061731, | |
| "grad_norm": NaN, | |
| "learning_rate": 7.35195530726257e-05, | |
| "loss": 2.6008926391601563, | |
| "step": 330 | |
| }, | |
| { | |
| "epoch": 0.011406716543093904, | |
| "grad_norm": NaN, | |
| "learning_rate": 7.575418994413408e-05, | |
| "loss": 13.484027099609374, | |
| "step": 340 | |
| }, | |
| { | |
| "epoch": 0.011742208206126079, | |
| "grad_norm": NaN, | |
| "learning_rate": 7.798882681564245e-05, | |
| "loss": 17.163206481933592, | |
| "step": 350 | |
| }, | |
| { | |
| "epoch": 0.012077699869158251, | |
| "grad_norm": NaN, | |
| "learning_rate": 8.022346368715084e-05, | |
| "loss": 8.245307922363281, | |
| "step": 360 | |
| }, | |
| { | |
| "epoch": 0.012413191532190426, | |
| "grad_norm": NaN, | |
| "learning_rate": 8.245810055865922e-05, | |
| "loss": 8.971550750732423, | |
| "step": 370 | |
| }, | |
| { | |
| "epoch": 0.012748683195222599, | |
| "grad_norm": NaN, | |
| "learning_rate": 8.46927374301676e-05, | |
| "loss": 8.085272979736327, | |
| "step": 380 | |
| }, | |
| { | |
| "epoch": 0.013084174858254772, | |
| "grad_norm": NaN, | |
| "learning_rate": 8.692737430167597e-05, | |
| "loss": 2.434987258911133, | |
| "step": 390 | |
| }, | |
| { | |
| "epoch": 0.013419666521286946, | |
| "grad_norm": NaN, | |
| "learning_rate": 8.916201117318435e-05, | |
| "loss": 17.522901916503905, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 0.013755158184319119, | |
| "grad_norm": NaN, | |
| "learning_rate": 9.139664804469274e-05, | |
| "loss": 9.243440246582031, | |
| "step": 410 | |
| }, | |
| { | |
| "epoch": 0.014090649847351294, | |
| "grad_norm": NaN, | |
| "learning_rate": 9.363128491620112e-05, | |
| "loss": 5.988158798217773, | |
| "step": 420 | |
| }, | |
| { | |
| "epoch": 0.014426141510383466, | |
| "grad_norm": NaN, | |
| "learning_rate": 9.58659217877095e-05, | |
| "loss": 9.994813537597656, | |
| "step": 430 | |
| }, | |
| { | |
| "epoch": 0.014761633173415641, | |
| "grad_norm": NaN, | |
| "learning_rate": 9.810055865921788e-05, | |
| "loss": 3.905954360961914, | |
| "step": 440 | |
| }, | |
| { | |
| "epoch": 0.015097124836447814, | |
| "grad_norm": NaN, | |
| "learning_rate": 0.00010033519553072626, | |
| "loss": 4.835385513305664, | |
| "step": 450 | |
| }, | |
| { | |
| "epoch": 0.015432616499479988, | |
| "grad_norm": NaN, | |
| "learning_rate": 0.00010256983240223464, | |
| "loss": 2.324123764038086, | |
| "step": 460 | |
| }, | |
| { | |
| "epoch": 0.015768108162512163, | |
| "grad_norm": NaN, | |
| "learning_rate": 0.00010480446927374301, | |
| "loss": 9.202623748779297, | |
| "step": 470 | |
| }, | |
| { | |
| "epoch": 0.016103599825544334, | |
| "grad_norm": NaN, | |
| "learning_rate": 0.0001070391061452514, | |
| "loss": 13.691998291015626, | |
| "step": 480 | |
| }, | |
| { | |
| "epoch": 0.01643909148857651, | |
| "grad_norm": NaN, | |
| "learning_rate": 0.0001092737430167598, | |
| "loss": 10.514191436767579, | |
| "step": 490 | |
| }, | |
| { | |
| "epoch": 0.016774583151608683, | |
| "grad_norm": NaN, | |
| "learning_rate": 0.00011150837988826817, | |
| "loss": 6.2412151336669925, | |
| "step": 500 | |
| } | |
| ], | |
| "logging_steps": 10, | |
| "max_steps": 29807, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 1, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 1.981900441329264e+16, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |