Instructions to use LanguageBind/MoE-LLaVA-Qwen-1.8B-4e with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LanguageBind/MoE-LLaVA-Qwen-1.8B-4e with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LanguageBind/MoE-LLaVA-Qwen-1.8B-4e", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("LanguageBind/MoE-LLaVA-Qwen-1.8B-4e", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LanguageBind/MoE-LLaVA-Qwen-1.8B-4e with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LanguageBind/MoE-LLaVA-Qwen-1.8B-4e" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LanguageBind/MoE-LLaVA-Qwen-1.8B-4e", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LanguageBind/MoE-LLaVA-Qwen-1.8B-4e
- SGLang
How to use LanguageBind/MoE-LLaVA-Qwen-1.8B-4e 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/MoE-LLaVA-Qwen-1.8B-4e" \ --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/MoE-LLaVA-Qwen-1.8B-4e", "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/MoE-LLaVA-Qwen-1.8B-4e" \ --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/MoE-LLaVA-Qwen-1.8B-4e", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LanguageBind/MoE-LLaVA-Qwen-1.8B-4e with Docker Model Runner:
docker model run hf.co/LanguageBind/MoE-LLaVA-Qwen-1.8B-4e
ModuleNotFoundError: No module named 'mpi4py'
#1
by Andyrasika - opened
I tried
python -m pip install git+https://github.com/mpi4py/mpi4py
but got error:
_configtest.c:2:10: fatal error: mpi.h: No such file or directory
2 | #include <mpi.h>
| ^~~~~~~
compilation terminated.
failure.
removing: _configtest.c _configtest.o
error: Cannot compile MPI programs. Check your configuration!!!
Installing mpi4py requires a working MPI implementation.
If you are running on a supercomputer or cluster, check with
the system administrator or refer to the system user guide.
Otherwise, if you are running on a laptop or desktop computer,
your may be missing the MPICH or Open MPI development package:
* On Fedora/RHEL systems, run:
$ sudo dnf install mpich-devel # for MPICH
$ sudo dnf install openmpi-devel # for Open MPI
* On Debian/Ubuntu systems, run:
$ sudo apt install libmpich-dev # for MPICH
$ sudo apt install libopenmpi-dev # for Open MPI
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mpi4py
Failed to build mpi4py
ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects
use command
deepspeed predict.py
then it works