LinkSoul/LLaSM-Audio-Instructions
Updated • 24 • 28
How to use LinkSoul/LLaSM-Cllama2 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="LinkSoul/LLaSM-Cllama2") # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("LinkSoul/LLaSM-Cllama2", dtype="auto")How to use LinkSoul/LLaSM-Cllama2 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "LinkSoul/LLaSM-Cllama2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "LinkSoul/LLaSM-Cllama2",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/LinkSoul/LLaSM-Cllama2
How to use LinkSoul/LLaSM-Cllama2 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "LinkSoul/LLaSM-Cllama2" \
--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/LLaSM-Cllama2",
"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/LLaSM-Cllama2" \
--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/LLaSM-Cllama2",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use LinkSoul/LLaSM-Cllama2 with Docker Model Runner:
docker model run hf.co/LinkSoul/LLaSM-Cllama2
开源,可商用的中英文双语语音-语言助手 LLaSM 以及中英文语音 SFT 数据集 LLaSM-Audio-Instructions,第一个支持中英文语音-文本多模态对话的开源可商用对话模型。
Talk is cheap, Show you the Demo.
模型:
百度网盘下载:
语言模型:
# clone the repository
git clone https://github.com/LinkSoul-AI/LLaSM
cd LLaSM
# install package
conda create -n llasm python=3.10 -y
conda activate llasm
pip install --upgrade pip
pip install -e .
export LLASM_DEVICE="cuda:0"
python infer.py \
--input_audio_file PATH/TO/YOUR/AUDIO \
--llasm_model PATH/TO/LLaSM/MODEL \
--llasm_audio_tower PATH/TO/WHISPER/MODEL \
--llm_type "Chinese_llama2" or "baichuan" \
欢迎加入微信群