Instructions to use TheBloke/Mixtral-8x7B-MoE-RP-Story-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/Mixtral-8x7B-MoE-RP-Story-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TheBloke/Mixtral-8x7B-MoE-RP-Story-GPTQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("TheBloke/Mixtral-8x7B-MoE-RP-Story-GPTQ") model = AutoModelForMultimodalLM.from_pretrained("TheBloke/Mixtral-8x7B-MoE-RP-Story-GPTQ") 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-MoE-RP-Story-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TheBloke/Mixtral-8x7B-MoE-RP-Story-GPTQ" # 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-MoE-RP-Story-GPTQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TheBloke/Mixtral-8x7B-MoE-RP-Story-GPTQ
- SGLang
How to use TheBloke/Mixtral-8x7B-MoE-RP-Story-GPTQ 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-MoE-RP-Story-GPTQ" \ --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-MoE-RP-Story-GPTQ", "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-MoE-RP-Story-GPTQ" \ --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-MoE-RP-Story-GPTQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TheBloke/Mixtral-8x7B-MoE-RP-Story-GPTQ with Docker Model Runner:
docker model run hf.co/TheBloke/Mixtral-8x7B-MoE-RP-Story-GPTQ
ValueError: ## Could not find model.layers.0.mlp.down_proj.* in model
Hi, I am experiencing similiar error while loading a model. ValueError: Unrecognized layer: model.layers.0.block_sparse_moe.experts.0.w1.bias
Same here, tried 32, 128 etc, same error.
hmm i played with loading it with autogptq and it said it loaded on my 24gb vram but for first response got this error
RuntimeError: cannot reshape tensor of 0 elements into shape [-1, 1, 0] because the unspecified dimension size -1 can be any value and is ambiguous
dunno what im doin wrong
Traceback (most recent call last):
File "D:\booga\text-generation-webui\modules\callbacks.py", line 57, in gentask
ret = self.mfunc(callback=_callback, *args, **self.kwargs)
File "D:\booga\text-generation-webui\modules\text_generation.py", line 351, in generate_with_callback
shared.model.generate(**kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\transformers\generation\utils.py", line 1764, in generate
return self.sample(
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\transformers\generation\utils.py", line 2861, in sample
outputs = self(
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\transformers\models\mixtral\modeling_mixtral.py", line 1213, in forward
outputs = self.model(
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\transformers\models\mixtral\modeling_mixtral.py", line 1081, in forward
layer_outputs = decoder_layer(
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\transformers\models\mixtral\modeling_mixtral.py", line 810, in forward
hidden_states, router_logits = self.block_sparse_moe(hidden_states)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\transformers\models\mixtral\modeling_mixtral.py", line 708, in forward
router_logits = self.gate(hidden_states)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\booga\text-generation-webui\installer_files\env\lib\site-packages\auto_gptq\nn_modules\qlinear\qlinear_cuda_old.py", line 239, in forward
zeros = zeros.reshape(-1, 1, zeros.shape[1] * zeros.shape[2])
RuntimeError: cannot reshape tensor of 0 elements into shape [-1, 1, 0] because the unspecified dimension size -1 can be any value and is ambiguous