Text Generation
Transformers
Safetensors
English
French
mistral
mergekit
Merge
text-generation-inference
Instructions to use ayoubkirouane/Mistral-Depth-UP-Scaled-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ayoubkirouane/Mistral-Depth-UP-Scaled-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ayoubkirouane/Mistral-Depth-UP-Scaled-9B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ayoubkirouane/Mistral-Depth-UP-Scaled-9B") model = AutoModelForCausalLM.from_pretrained("ayoubkirouane/Mistral-Depth-UP-Scaled-9B") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ayoubkirouane/Mistral-Depth-UP-Scaled-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ayoubkirouane/Mistral-Depth-UP-Scaled-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ayoubkirouane/Mistral-Depth-UP-Scaled-9B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ayoubkirouane/Mistral-Depth-UP-Scaled-9B
- SGLang
How to use ayoubkirouane/Mistral-Depth-UP-Scaled-9B 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 "ayoubkirouane/Mistral-Depth-UP-Scaled-9B" \ --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": "ayoubkirouane/Mistral-Depth-UP-Scaled-9B", "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 "ayoubkirouane/Mistral-Depth-UP-Scaled-9B" \ --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": "ayoubkirouane/Mistral-Depth-UP-Scaled-9B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ayoubkirouane/Mistral-Depth-UP-Scaled-9B with Docker Model Runner:
docker model run hf.co/ayoubkirouane/Mistral-Depth-UP-Scaled-9B
Mistral-Depth-UP-Scaled-9B
An auto-regressive causal LM created by combining 2x finetuned mistral 7B into one.
Benchmarks
Coming soon.
Usage :
# Load in4Bit
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch
nf4_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.bfloat16
)
model = AutoModelForCausalLM.from_pretrained(
"ayoubkirouane/Mistral-Depth-UP-Scaled-9B",
device_map='auto',
quantization_config=nf4_config,
use_cache=False
)
tokenizer = AutoTokenizer.from_pretrained("ayoubkirouane/Mistral-Depth-UP-Scaled-9B")
tokenizer.pad_token = tokenizer.eos_token
tokenizer.padding_side = "right"
def generate_response(prompt, model , max_new_tokens):
encoded_input = tokenizer(prompt, return_tensors="pt", add_special_tokens=True)
model_inputs = encoded_input.to('cuda')
generated_ids = model.generate(**model_inputs, max_new_tokens=max_new_tokens, do_sample=True, pad_token_id=tokenizer.eos_token_id)
decoded_output = tokenizer.batch_decode(generated_ids)
return decoded_output[0].replace(prompt, "")
generate_response(prompt="What is GANs ?", model=model , max_new_tokens=100)
- Downloads last month
- 5