Instructions to use LanguageBind/Video-LLaVA-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LanguageBind/Video-LLaVA-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LanguageBind/Video-LLaVA-7B")# Load model directly from transformers import AutoProcessor, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("LanguageBind/Video-LLaVA-7B") model = AutoModelForCausalLM.from_pretrained("LanguageBind/Video-LLaVA-7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use LanguageBind/Video-LLaVA-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LanguageBind/Video-LLaVA-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LanguageBind/Video-LLaVA-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LanguageBind/Video-LLaVA-7B
- SGLang
How to use LanguageBind/Video-LLaVA-7B 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 "LanguageBind/Video-LLaVA-7B" \ --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": "LanguageBind/Video-LLaVA-7B", "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 "LanguageBind/Video-LLaVA-7B" \ --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": "LanguageBind/Video-LLaVA-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LanguageBind/Video-LLaVA-7B with Docker Model Runner:
docker model run hf.co/LanguageBind/Video-LLaVA-7B
Unable to load the model using transformers
Hi,
I'm trying to load the model using the below code but I'm getting error in downloading the model.
Code:
Load model directly
from transformers import AutoProcessor, AutoModelForCausalLM
processor = AutoProcessor.from_pretrained("LanguageBind/Video-LLaVA-7B")
model = AutoModelForCausalLM.from_pretrained("LanguageBind/Video-LLaVA-7B")
Output Error :
File /kaggle/working/transformers/utils/hub.py:452, in cached_file(path_or_repo_id, filename, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)
450 if revision is None:
451 revision = "main"
--> 452 raise EnvironmentError(
453 f"{path_or_repo_id} does not appear to have a file named {full_filename}. Checkout "
454 f"'https://huggingface.co/ class="ansi-bold" style="color:rgb(175,95,135)">{path_or_repo_id}/{revision}' for available files."
455 ) from e
456 except HTTPError as err:
457 resolved_file = _get_cache_file_to_return(path_or_repo_id, full_filename, cache_dir, revision)
OSError: LanguageBind/Video-LLaVA-7B does not appear to have a file named preprocessor_config.json. Checkout 'https://huggingface.co/LanguageBind/Video-LLaVA-7B/main' for available files.
How to solve this issue ? Is the model available through transformers ?
Hey!
The model is not yet supported by transformers. We are in the process of adding it, please take a look here