Run this model with HF Jobs
Run microsoft/OmniParser 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/microsoft/OmniParser. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/microsoft/OmniParser on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/microsoft/OmniParser. 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/microsoft/OmniParser. 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 microsoft/OmniParser with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/OmniParser with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="microsoft/OmniParser")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("microsoft/OmniParser") model = AutoModelForMultimodalLM.from_pretrained("microsoft/OmniParser", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use microsoft/OmniParser with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "microsoft/OmniParser" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/OmniParser", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/microsoft/OmniParser
- SGLang
How to use microsoft/OmniParser 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 "microsoft/OmniParser" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/OmniParser", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "microsoft/OmniParser" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/OmniParser", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use microsoft/OmniParser with Docker Model Runner:
docker model run hf.co/microsoft/OmniParser
upload
Browse filesFiles changed (6)
12345678910111213141516171819202122232425262728293031323334353637383940{ "_name_or_path": "Salesforce/blip2-opt-2.7b", "architectures": [ "Blip2ForConditionalGeneration" ], "initializer_factor": 1.0, "initializer_range": 0.02, "model_type": "blip-2", "num_query_tokens": 32, "qformer_config": { "classifier_dropout": null, "model_type": "blip_2_qformer" }, "text_config": { "_name_or_path": "facebook/opt-2.7b", "activation_dropout": 0.0, "architectures": [ "OPTForCausalLM" ], "eos_token_id": 50118, "ffn_dim": 10240, "hidden_size": 2560, "model_type": "opt", "num_attention_heads": 32, "num_hidden_layers": 32, "prefix": "</s>", "torch_dtype": "float16", "word_embed_proj_dim": 2560 }, "torch_dtype": "bfloat16", "transformers_version": "4.40.2", "use_decoder_only_language_model": true, "vision_config": { "dropout": 0.0, "initializer_factor": 1.0, "model_type": "blip_2_vision_model", "num_channels": 3, "projection_dim": 512 }}1234567{ "_from_model_config": true, "bos_token_id": 2, "eos_token_id": 50118, "pad_token_id": 1, "transformers_version": "4.40.2"}123version https://git-lfs.github.com/spec/v1oid sha256:7d7c9438dc62272d956079e7bf54a9bfc888dd8337841f3f67ea813a4a21a957size 4998300711123version https://git-lfs.github.com/spec/v1oid sha256:b7b1fd628d150593ba14b937fac61c2b41529a21bf991c227f828113712813d0size 2491516218123version https://git-lfs.github.com/spec/v1oid sha256:7217061db1b3008cfc83e44c9fb635d3635167e6c97804d85efe7ec409d4f967size 6310937icon_caption_blip2/config.jsonAdded+40
icon_caption_blip2/generation_config.jsonAdded+7
icon_caption_blip2/pytorch_model-00001-of-00002.binAdded+3
icon_caption_blip2/pytorch_model-00002-of-00002.binAdded+3
icon_caption_blip2/pytorch_model.bin.index.jsonAdded
icon_detect/best.ptAdded+3