Image-Text-to-Text
Transformers
Safetensors
llava_next
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral") 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("htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral") model = AutoModelForMultimodalLM.from_pretrained("htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral", 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 htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral", "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/htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral
- SGLang
How to use htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral 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 "htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral" \ --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": "htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral", "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 "htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral" \ --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": "htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral", "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 htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral with Docker Model Runner:
docker model run hf.co/htlou/backup_0202_llamafactory_Compcap_cooccur_0_10-llava-mistral
| {"current_steps": 5, "total_steps": 111, "loss": 1.7475, "learning_rate": 5e-07, "epoch": 0.13513513513513514, "percentage": 4.5, "elapsed_time": "0:01:09", "remaining_time": "0:24:28"} | |
| {"current_steps": 10, "total_steps": 111, "loss": 1.5992, "learning_rate": 1e-06, "epoch": 0.2702702702702703, "percentage": 9.01, "elapsed_time": "0:02:14", "remaining_time": "0:22:33"} | |
| {"current_steps": 15, "total_steps": 111, "loss": 1.299, "learning_rate": 9.939652198703783e-07, "epoch": 0.40540540540540543, "percentage": 13.51, "elapsed_time": "0:03:20", "remaining_time": "0:21:20"} | |
| {"current_steps": 20, "total_steps": 111, "loss": 1.1371, "learning_rate": 9.76006553766365e-07, "epoch": 0.5405405405405406, "percentage": 18.02, "elapsed_time": "0:04:25", "remaining_time": "0:20:06"} | |
| {"current_steps": 25, "total_steps": 111, "loss": 1.064, "learning_rate": 9.465575080933957e-07, "epoch": 0.6756756756756757, "percentage": 22.52, "elapsed_time": "0:05:31", "remaining_time": "0:18:59"} | |
| {"current_steps": 30, "total_steps": 111, "loss": 1.013, "learning_rate": 9.063289569141251e-07, "epoch": 0.8108108108108109, "percentage": 27.03, "elapsed_time": "0:06:36", "remaining_time": "0:17:49"} | |
| {"current_steps": 35, "total_steps": 111, "loss": 0.9957, "learning_rate": 8.562919820737535e-07, "epoch": 0.9459459459459459, "percentage": 31.53, "elapsed_time": "0:07:41", "remaining_time": "0:16:42"} | |
| {"current_steps": 40, "total_steps": 111, "loss": 0.9521, "learning_rate": 7.97654432138333e-07, "epoch": 1.0810810810810811, "percentage": 36.04, "elapsed_time": "0:08:46", "remaining_time": "0:15:34"} | |
| {"current_steps": 45, "total_steps": 111, "loss": 0.9176, "learning_rate": 7.318317659926636e-07, "epoch": 1.2162162162162162, "percentage": 40.54, "elapsed_time": "0:09:51", "remaining_time": "0:14:27"} | |
| {"current_steps": 50, "total_steps": 111, "loss": 0.8959, "learning_rate": 6.604128849076838e-07, "epoch": 1.3513513513513513, "percentage": 45.05, "elapsed_time": "0:10:56", "remaining_time": "0:13:21"} | |
| {"current_steps": 50, "total_steps": 111, "eval_loss": 0.9550710320472717, "epoch": 1.3513513513513513, "percentage": 45.05, "elapsed_time": "0:11:16", "remaining_time": "0:13:44"} | |
| {"current_steps": 55, "total_steps": 111, "loss": 0.8854, "learning_rate": 5.851217778611993e-07, "epoch": 1.4864864864864864, "percentage": 49.55, "elapsed_time": "0:12:21", "remaining_time": "0:12:34"} | |
| {"current_steps": 60, "total_steps": 111, "loss": 0.8564, "learning_rate": 5.077759059601755e-07, "epoch": 1.6216216216216215, "percentage": 54.05, "elapsed_time": "0:13:26", "remaining_time": "0:11:25"} | |
| {"current_steps": 65, "total_steps": 111, "loss": 0.8855, "learning_rate": 4.302423305280385e-07, "epoch": 1.7567567567567568, "percentage": 58.56, "elapsed_time": "0:14:32", "remaining_time": "0:10:17"} | |
| {"current_steps": 70, "total_steps": 111, "loss": 0.8806, "learning_rate": 3.54392643886374e-07, "epoch": 1.8918918918918919, "percentage": 63.06, "elapsed_time": "0:15:37", "remaining_time": "0:09:09"} | |
| {"current_steps": 75, "total_steps": 111, "loss": 0.8547, "learning_rate": 2.8205779076231446e-07, "epoch": 2.027027027027027, "percentage": 67.57, "elapsed_time": "0:16:43", "remaining_time": "0:08:01"} | |
| {"current_steps": 80, "total_steps": 111, "loss": 0.8263, "learning_rate": 2.1498387089310865e-07, "epoch": 2.1621621621621623, "percentage": 72.07, "elapsed_time": "0:17:49", "remaining_time": "0:06:54"} | |
| {"current_steps": 85, "total_steps": 111, "loss": 0.8104, "learning_rate": 1.5478998971412666e-07, "epoch": 2.2972972972972974, "percentage": 76.58, "elapsed_time": "0:18:55", "remaining_time": "0:05:47"} | |
| {"current_steps": 90, "total_steps": 111, "loss": 0.8137, "learning_rate": 1.0292917457762323e-07, "epoch": 2.4324324324324325, "percentage": 81.08, "elapsed_time": "0:20:00", "remaining_time": "0:04:40"} | |
| {"current_steps": 95, "total_steps": 111, "loss": 0.8102, "learning_rate": 6.065329995036572e-08, "epoch": 2.5675675675675675, "percentage": 85.59, "elapsed_time": "0:21:05", "remaining_time": "0:03:33"} | |
| {"current_steps": 100, "total_steps": 111, "loss": 0.8066, "learning_rate": 2.8982868265005454e-08, "epoch": 2.7027027027027026, "percentage": 90.09, "elapsed_time": "0:22:11", "remaining_time": "0:02:26"} | |
| {"current_steps": 100, "total_steps": 111, "eval_loss": 0.9287886619567871, "epoch": 2.7027027027027026, "percentage": 90.09, "elapsed_time": "0:22:30", "remaining_time": "0:02:28"} | |
| {"current_steps": 105, "total_steps": 111, "loss": 0.8146, "learning_rate": 8.682375888868166e-09, "epoch": 2.8378378378378377, "percentage": 94.59, "elapsed_time": "0:23:35", "remaining_time": "0:01:20"} | |
| {"current_steps": 110, "total_steps": 111, "loss": 0.7984, "learning_rate": 2.418588540059607e-10, "epoch": 2.972972972972973, "percentage": 99.1, "elapsed_time": "0:24:40", "remaining_time": "0:00:13"} | |
| {"current_steps": 111, "total_steps": 111, "epoch": 3.0, "percentage": 100.0, "elapsed_time": "0:25:24", "remaining_time": "0:00:00"} | |