Text Generation
Transformers
PyTorch
mpt
Composer
MosaicML
llm-foundry
custom_code
text-generation-inference
Instructions to use debisoft/mpt-7b-8k-instruct-peft-compatible with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use debisoft/mpt-7b-8k-instruct-peft-compatible with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="debisoft/mpt-7b-8k-instruct-peft-compatible", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("debisoft/mpt-7b-8k-instruct-peft-compatible", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("debisoft/mpt-7b-8k-instruct-peft-compatible", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use debisoft/mpt-7b-8k-instruct-peft-compatible with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "debisoft/mpt-7b-8k-instruct-peft-compatible" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "debisoft/mpt-7b-8k-instruct-peft-compatible", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/debisoft/mpt-7b-8k-instruct-peft-compatible
- SGLang
How to use debisoft/mpt-7b-8k-instruct-peft-compatible 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 "debisoft/mpt-7b-8k-instruct-peft-compatible" \ --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": "debisoft/mpt-7b-8k-instruct-peft-compatible", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "debisoft/mpt-7b-8k-instruct-peft-compatible" \ --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": "debisoft/mpt-7b-8k-instruct-peft-compatible", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use debisoft/mpt-7b-8k-instruct-peft-compatible with Docker Model Runner:
docker model run hf.co/debisoft/mpt-7b-8k-instruct-peft-compatible
Added output_attentions: bool=False to GroupedQueryAttention.forward() as a temporary fix for AWQ
Browse files- attention.py +1 -1
attention.py
CHANGED
|
@@ -260,7 +260,7 @@ class GroupedQueryAttention(nn.Module):
|
|
| 260 |
self.out_proj = FC_CLASS_REGISTRY[fc_type](self.d_model, self.d_model, **fc_kwargs)
|
| 261 |
self.out_proj._is_residual = True
|
| 262 |
|
| 263 |
-
def forward(self, x: torch.Tensor, past_key_value: Optional[Tuple[torch.Tensor, torch.Tensor]]=None, attn_bias: Optional[torch.Tensor]=None, attention_mask: Optional[torch.Tensor]=None, is_causal: bool=True, needs_weights: bool=False) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor, torch.Tensor]]]:
|
| 264 |
qkv = self.Wqkv(x)
|
| 265 |
if self.clip_qkv:
|
| 266 |
qkv = qkv.clamp(min=-self.clip_qkv, max=self.clip_qkv)
|
|
|
|
| 260 |
self.out_proj = FC_CLASS_REGISTRY[fc_type](self.d_model, self.d_model, **fc_kwargs)
|
| 261 |
self.out_proj._is_residual = True
|
| 262 |
|
| 263 |
+
def forward(self, x: torch.Tensor, past_key_value: Optional[Tuple[torch.Tensor, torch.Tensor]]=None, attn_bias: Optional[torch.Tensor]=None, attention_mask: Optional[torch.Tensor]=None, is_causal: bool=True, output_attentions: bool=False, needs_weights: bool=False) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor, torch.Tensor]]]:
|
| 264 |
qkv = self.Wqkv(x)
|
| 265 |
if self.clip_qkv:
|
| 266 |
qkv = qkv.clamp(min=-self.clip_qkv, max=self.clip_qkv)
|