Text Generation
Transformers
Safetensors
mistral
trl
sft
Generated from Trainer
conversational
text-generation-inference
Instructions to use ledat1205/mistral-instruct-v2-2k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ledat1205/mistral-instruct-v2-2k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ledat1205/mistral-instruct-v2-2k") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ledat1205/mistral-instruct-v2-2k") model = AutoModelForCausalLM.from_pretrained("ledat1205/mistral-instruct-v2-2k", 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 ledat1205/mistral-instruct-v2-2k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ledat1205/mistral-instruct-v2-2k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ledat1205/mistral-instruct-v2-2k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ledat1205/mistral-instruct-v2-2k
- SGLang
How to use ledat1205/mistral-instruct-v2-2k 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 "ledat1205/mistral-instruct-v2-2k" \ --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": "ledat1205/mistral-instruct-v2-2k", "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 "ledat1205/mistral-instruct-v2-2k" \ --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": "ledat1205/mistral-instruct-v2-2k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ledat1205/mistral-instruct-v2-2k with Docker Model Runner:
docker model run hf.co/ledat1205/mistral-instruct-v2-2k
transformers
This model was trained from scratch on the generator dataset. It achieves the following results on the evaluation set:
- Loss: 0.3956
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.0002
- train_batch_size: 48
- eval_batch_size: 12
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 74
- training_steps: 743
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.2297 | 1.8 | 74 | 0.4019 |
| 0.1551 | 3.61 | 148 | 0.4087 |
| 0.1306 | 5.41 | 222 | 0.4018 |
| 0.0894 | 7.22 | 296 | 0.3998 |
| 0.0799 | 9.02 | 370 | 0.3972 |
| 0.0782 | 10.83 | 444 | 0.3965 |
| 0.0748 | 12.63 | 518 | 0.3967 |
| 0.0617 | 14.44 | 592 | 0.3964 |
| 0.0666 | 16.24 | 666 | 0.3956 |
| 0.0753 | 18.05 | 740 | 0.3956 |
Framework versions
- Transformers 4.39.2
- Pytorch 2.1.0+cu118
- Datasets 2.16.0
- Tokenizers 0.15.2
- Downloads last month
- 5