Instructions to use Emma02/LVM_ckpts with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Emma02/LVM_ckpts with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Emma02/LVM_ckpts")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Emma02/LVM_ckpts") model = AutoModelForCausalLM.from_pretrained("Emma02/LVM_ckpts") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Emma02/LVM_ckpts with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Emma02/LVM_ckpts" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Emma02/LVM_ckpts", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Emma02/LVM_ckpts
- SGLang
How to use Emma02/LVM_ckpts 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 "Emma02/LVM_ckpts" \ --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": "Emma02/LVM_ckpts", "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 "Emma02/LVM_ckpts" \ --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": "Emma02/LVM_ckpts", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Emma02/LVM_ckpts with Docker Model Runner:
docker model run hf.co/Emma02/LVM_ckpts
How to use this model?
#2
by htangmerl - opened
Hi, may I know how to use this model? Is there any demo?
- I tried to load this checkpoint using hugging face pipeline or loading tokenizers separately. Both failed due to
OSError: Can't load tokenizer for 'Emma02/LVM_ckpts'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'Emma02/LVM_ckpts' is the correct path to a directory containing all relevant files for a LlamaTokenizerFast tokenizer. - I have also tried https://github.com/ytongbai/LVM/tree/main , which I cannot find the checkpoints for this repo. The evaluation demo is not directly runnable either.
Could you please share a naive demo to show how to use this model? How to load the model and run prompts as list of images. Thanks!
HI it isn't working?