Run this model with HF Jobs
Run trl-internal-testing/tiny-LlavaNextForConditionalGeneration on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/trl-internal-testing/tiny-LlavaNextForConditionalGeneration. Ask me which dataset to train on, then push the LoRA adapter to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs and Transformers to run batch inference with https://huggingface.co/trl-internal-testing/tiny-LlavaNextForConditionalGeneration on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the predictions back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs and Lighteval to evaluate https://huggingface.co/trl-internal-testing/tiny-LlavaNextForConditionalGeneration. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/trl-internal-testing/tiny-LlavaNextForConditionalGeneration with Transformers and bitsandbytes. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use trl-internal-testing/tiny-LlavaNextForConditionalGeneration with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trl-internal-testing/tiny-LlavaNextForConditionalGeneration with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="trl-internal-testing/tiny-LlavaNextForConditionalGeneration") 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("trl-internal-testing/tiny-LlavaNextForConditionalGeneration") model = AutoModelForMultimodalLM.from_pretrained("trl-internal-testing/tiny-LlavaNextForConditionalGeneration", 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 trl-internal-testing/tiny-LlavaNextForConditionalGeneration with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trl-internal-testing/tiny-LlavaNextForConditionalGeneration" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trl-internal-testing/tiny-LlavaNextForConditionalGeneration", "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/trl-internal-testing/tiny-LlavaNextForConditionalGeneration
- SGLang
How to use trl-internal-testing/tiny-LlavaNextForConditionalGeneration 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 "trl-internal-testing/tiny-LlavaNextForConditionalGeneration" \ --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": "trl-internal-testing/tiny-LlavaNextForConditionalGeneration", "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 "trl-internal-testing/tiny-LlavaNextForConditionalGeneration" \ --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": "trl-internal-testing/tiny-LlavaNextForConditionalGeneration", "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" } } ] } ] }' - Docker Model Runner
How to use trl-internal-testing/tiny-LlavaNextForConditionalGeneration with Docker Model Runner:
docker model run hf.co/trl-internal-testing/tiny-LlavaNextForConditionalGeneration
Upload LlavaNextForConditionalGeneration
Browse filesFiles changed (3)
1 unmodified line234567828 unmodified lines373839404142434445464748492 unmodified lines5253545255565758575859606162636465661 unmodified line "architectures": [ "LlavaNextForConditionalGeneration" ], "dtype": "bfloat16", "ignore_index": -100, "image_grid_pinpoints": [ [28 unmodified lines "MistralForCausalLM" ], "attention_dropout": 0.0, "dtype": "bfloat16", "head_dim": null, "hidden_act": "silu", "hidden_size": 16, "initializer_range": 0.02, "intermediate_size": 14336, "layer_types": null, "max_position_embeddings": 32768, "model_type": "mistral", "num_attention_heads": 4,2 unmodified lines "rms_norm_eps": 1e-05, "rope_theta": 1000000.0, "sliding_window": null, "torch_dtype": "bfloat16", "use_cache": true, "vocab_size": 32064 }, "tie_word_embeddings": false, "torch_dtype": "bfloat16", "transformers_version": "4.56.0.dev0", "transformers_version": "4.57.0.dev0", "use_image_newline_parameter": true, "vision_config": { "attention_dropout": 0.0, "embed_dim": 32, "hidden_act": "quick_gelu", "hidden_size": 16, "image_size": 336,1 unmodified line2345561 unmodified line "_from_model_config": true, "bos_token_id": 1, "eos_token_id": 2, "transformers_version": "4.56.0.dev0" "transformers_version": "4.57.0.dev0"}1223version https://git-lfs.github.com/spec/v1oid sha256:de69f2ae14700ea96ced1956f7613d0e2f245831b3bbb7cb91de653ddebbcc38oid sha256:346f654b90cd0fafed9c3417b66251d23252047a55a994e5c699803f3d7b7317size 5399728config.json+5-3
generation_config.json+1-1
model.safetensors+1-1