LinkSoul/Chinese-LLaVA-Vision-Instructions
Viewer • Updated • 1.82M • 269 • 71
How to use LinkSoul/Chinese-LLaVA-Baichuan with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="LinkSoul/Chinese-LLaVA-Baichuan") # Load model directly
from transformers import AutoProcessor, AutoModelForCausalLM
processor = AutoProcessor.from_pretrained("LinkSoul/Chinese-LLaVA-Baichuan")
model = AutoModelForCausalLM.from_pretrained("LinkSoul/Chinese-LLaVA-Baichuan")How to use LinkSoul/Chinese-LLaVA-Baichuan with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "LinkSoul/Chinese-LLaVA-Baichuan"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "LinkSoul/Chinese-LLaVA-Baichuan",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/LinkSoul/Chinese-LLaVA-Baichuan
How to use LinkSoul/Chinese-LLaVA-Baichuan with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "LinkSoul/Chinese-LLaVA-Baichuan" \
--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": "LinkSoul/Chinese-LLaVA-Baichuan",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "LinkSoul/Chinese-LLaVA-Baichuan" \
--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": "LinkSoul/Chinese-LLaVA-Baichuan",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use LinkSoul/Chinese-LLaVA-Baichuan with Docker Model Runner:
docker model run hf.co/LinkSoul/Chinese-LLaVA-Baichuan
开源,可商用的中英文双语视觉-语言助手 Chinese-LLaVA 以及中英文视觉 SFT 数据集 Chinese-LLaVA-Vision-Instructions,支持中英文视觉-文本多模态对话的开源可商用对话模型。
Talk is cheap, Show you the Demo.
模型:
百度网盘下载:
语言模型:
# clone the repository
git clone https://github.com/LinkSoul-AI/Chinese-LLaVA
cd Chinese-LLaVA
# install package
conda create -n Cllava python=3.10 -y
conda activate Cllava
pip install --upgrade pip
pip install -e .
python infer.py \
--model-name PATH/TO/THE/CHINESE_LLAVA_MODEL \
--llm-type "Chinese_llama2" or "baichuan" \
--image-file PATH/TO/THE/INPUT/IMAGE \
--query QUERY/PROMPT
欢迎加入微信群