Instructions to use TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ") model = AutoModelForCausalLM.from_pretrained("TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ
- SGLang
How to use TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ 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 "TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ with Docker Model Runner:
docker model run hf.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ
always getting 0 in output
the model always respond with token id 0 for any input, while same prompt can get correct response from https://huggingface.co/casperhansen/mixtral-instruct-awq
tested with vllm
llm = LLM(model=model_path, quantization="awq", trust_remote_code=True, dtype="auto", enforce_eager=True, max_model_len=12288)
same for me!
Is there any fix for that?
Also happening for me. Seems to be an issue with this model. Other 8x7b awq models work perfectly fine, for example dolphin-2.7-8x7b.
@TheBloke Any update about this issue? Always get an empty output as well...
FYI,
python3 -m vllm.entrypoints.openai.api_server --model "$MODEL_NAME" --host 0.0.0.0 --port 8181 --quantization awq --dtype auto
"choices": [
{
"index": 0,
"text": "",
"logprobs": null,
"finish_reason": "length"
}
],
same, maybe a prompt template issue?
Any update ?
俺也一样
Also seeing this in testing. Our vLLM setup:
sampling_params = SamplingParams(temperature=0.1, top_p=0.95)
model = 'TheBloke/Mixtral-8x7B-Instruct-v0.1-AWQ'
llm = LLM(
model=model,
gpu_memory_utilization=0.7,
max_model_len=2048,
)
prompt的原因,可以尝试改成f"""USER:{prompt}\nAssistant:"""
Same here...
same
I’ve heard that this version works fine with vLLM: https://huggingface.co/casperhansen/mixtral-instruct-awq
Yes, I uploaded it since this repository has a corrupted model (somehow). Please requantize if you experience any problem.