Note
: This is a basic 4-bit quantization using bitsandbytes.
For better performance and accuracy, we recommend using our
GPTQ-quantized version
which maintains higher quality while still providing significant memory savings.
Usage
Load Model
from transformers import AutoModelForCausalLM, AutoProcessor, AutoTokenizer
model_id = "mispeech/midashenglm-7b-0804-4bit-bnb"# "mispeech/midashenglm-7b-0804-w4a16-gptq" is more recommended
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_id)
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
Construct Prompt
user_prompt = "Caption the audio."# You may try any other prompt
messages = [
{
"role": "system",
"content": [
{"type": "text", "text": "You are a helpful language and speech assistant."}
],
},
{
"role": "user",
"content": [
{"type": "text", "text": user_prompt},
{
"type": "audio",
"path": "/path/to/example.wav",
# or "url": "https://example.com/example.wav"# or "audio": np.random.randn(16000)
},
],
},
]
midashenglm-7b-0804-4bit-bnb huggingface.co is an AI model on huggingface.co that provides midashenglm-7b-0804-4bit-bnb's model effect (), which can be used instantly with this mispeech midashenglm-7b-0804-4bit-bnb model. huggingface.co supports a free trial of the midashenglm-7b-0804-4bit-bnb model, and also provides paid use of the midashenglm-7b-0804-4bit-bnb. Support call midashenglm-7b-0804-4bit-bnb model through api, including Node.js, Python, http.
midashenglm-7b-0804-4bit-bnb huggingface.co is an online trial and call api platform, which integrates midashenglm-7b-0804-4bit-bnb's modeling effects, including api services, and provides a free online trial of midashenglm-7b-0804-4bit-bnb, you can try midashenglm-7b-0804-4bit-bnb online for free by clicking the link below.
mispeech midashenglm-7b-0804-4bit-bnb online free url in huggingface.co:
midashenglm-7b-0804-4bit-bnb is an open source model from GitHub that offers a free installation service, and any user can find midashenglm-7b-0804-4bit-bnb on GitHub to install. At the same time, huggingface.co provides the effect of midashenglm-7b-0804-4bit-bnb install, users can directly use midashenglm-7b-0804-4bit-bnb installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
midashenglm-7b-0804-4bit-bnb install url in huggingface.co: