Text Generation
Transformers
Safetensors
mistral
alignment-handbook
trl
sft
Generated from Trainer
conversational
text-generation-inference
Instructions to use amdevraj/mistral-7b-ift with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amdevraj/mistral-7b-ift with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="amdevraj/mistral-7b-ift") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("amdevraj/mistral-7b-ift") model = AutoModelForCausalLM.from_pretrained("amdevraj/mistral-7b-ift") 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 amdevraj/mistral-7b-ift with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amdevraj/mistral-7b-ift" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amdevraj/mistral-7b-ift", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/amdevraj/mistral-7b-ift
- SGLang
How to use amdevraj/mistral-7b-ift 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 "amdevraj/mistral-7b-ift" \ --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": "amdevraj/mistral-7b-ift", "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 "amdevraj/mistral-7b-ift" \ --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": "amdevraj/mistral-7b-ift", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use amdevraj/mistral-7b-ift with Docker Model Runner:
docker model run hf.co/amdevraj/mistral-7b-ift
Model save
Browse files- README.md +11 -15
- all_results.json +6 -11
- train_results.json +6 -6
- trainer_state.json +0 -0
README.md
CHANGED
|
@@ -3,15 +3,11 @@ library_name: transformers
|
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: mistralai/Mistral-7B-v0.3
|
| 5 |
tags:
|
| 6 |
-
- alignment-handbook
|
| 7 |
-
- trl
|
| 8 |
-
- sft
|
| 9 |
-
- generated_from_trainer
|
| 10 |
- trl
|
| 11 |
- sft
|
| 12 |
- generated_from_trainer
|
| 13 |
datasets:
|
| 14 |
-
-
|
| 15 |
model-index:
|
| 16 |
- name: mistral-7b-ift
|
| 17 |
results: []
|
|
@@ -22,9 +18,9 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 22 |
|
| 23 |
# mistral-7b-ift
|
| 24 |
|
| 25 |
-
This model is a fine-tuned version of [mistralai/Mistral-7B-v0.3](https://huggingface.co/mistralai/Mistral-7B-v0.3) on the
|
| 26 |
It achieves the following results on the evaluation set:
|
| 27 |
-
- Loss: 0.
|
| 28 |
|
| 29 |
## Model description
|
| 30 |
|
|
@@ -48,10 +44,10 @@ The following hyperparameters were used during training:
|
|
| 48 |
- eval_batch_size: 8
|
| 49 |
- seed: 42
|
| 50 |
- distributed_type: multi-GPU
|
| 51 |
-
- num_devices:
|
| 52 |
- gradient_accumulation_steps: 4
|
| 53 |
-
- total_train_batch_size:
|
| 54 |
-
- total_eval_batch_size:
|
| 55 |
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
| 56 |
- lr_scheduler_type: cosine
|
| 57 |
- lr_scheduler_warmup_ratio: 0.1
|
|
@@ -59,11 +55,11 @@ The following hyperparameters were used during training:
|
|
| 59 |
|
| 60 |
### Training results
|
| 61 |
|
| 62 |
-
| Training Loss | Epoch
|
| 63 |
-
|:-------------:|:-----:|:----:|:---------------:|
|
| 64 |
-
| 0.
|
| 65 |
-
| 0.
|
| 66 |
-
| 0.
|
| 67 |
|
| 68 |
|
| 69 |
### Framework versions
|
|
|
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: mistralai/Mistral-7B-v0.3
|
| 5 |
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
- trl
|
| 7 |
- sft
|
| 8 |
- generated_from_trainer
|
| 9 |
datasets:
|
| 10 |
+
- generator
|
| 11 |
model-index:
|
| 12 |
- name: mistral-7b-ift
|
| 13 |
results: []
|
|
|
|
| 18 |
|
| 19 |
# mistral-7b-ift
|
| 20 |
|
| 21 |
+
This model is a fine-tuned version of [mistralai/Mistral-7B-v0.3](https://huggingface.co/mistralai/Mistral-7B-v0.3) on the generator dataset.
|
| 22 |
It achieves the following results on the evaluation set:
|
| 23 |
+
- Loss: 0.9529
|
| 24 |
|
| 25 |
## Model description
|
| 26 |
|
|
|
|
| 44 |
- eval_batch_size: 8
|
| 45 |
- seed: 42
|
| 46 |
- distributed_type: multi-GPU
|
| 47 |
+
- num_devices: 8
|
| 48 |
- gradient_accumulation_steps: 4
|
| 49 |
+
- total_train_batch_size: 256
|
| 50 |
+
- total_eval_batch_size: 64
|
| 51 |
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
| 52 |
- lr_scheduler_type: cosine
|
| 53 |
- lr_scheduler_warmup_ratio: 0.1
|
|
|
|
| 55 |
|
| 56 |
### Training results
|
| 57 |
|
| 58 |
+
| Training Loss | Epoch | Step | Validation Loss |
|
| 59 |
+
|:-------------:|:------:|:----:|:---------------:|
|
| 60 |
+
| 0.9643 | 0.9989 | 455 | 1.0198 |
|
| 61 |
+
| 0.9077 | 2.0 | 911 | 0.9618 |
|
| 62 |
+
| 0.8919 | 2.9967 | 1365 | 0.9529 |
|
| 63 |
|
| 64 |
|
| 65 |
### Framework versions
|
all_results.json
CHANGED
|
@@ -1,14 +1,9 @@
|
|
| 1 |
{
|
| 2 |
-
"epoch":
|
| 3 |
-
"
|
| 4 |
-
"
|
| 5 |
-
"
|
| 6 |
-
"eval_samples_per_second": 43.758,
|
| 7 |
-
"eval_steps_per_second": 1.469,
|
| 8 |
-
"total_flos": 572182254059520.0,
|
| 9 |
-
"train_loss": 0.9187763968187508,
|
| 10 |
-
"train_runtime": 32723.3769,
|
| 11 |
"train_samples": 77486,
|
| 12 |
-
"train_samples_per_second":
|
| 13 |
-
"train_steps_per_second": 0.
|
| 14 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"epoch": 2.996706915477497,
|
| 3 |
+
"total_flos": 571501770178560.0,
|
| 4 |
+
"train_loss": 0.9509169136648213,
|
| 5 |
+
"train_runtime": 15780.8295,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
"train_samples": 77486,
|
| 7 |
+
"train_samples_per_second": 22.162,
|
| 8 |
+
"train_steps_per_second": 0.086
|
| 9 |
}
|
train_results.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
{
|
| 2 |
-
"epoch":
|
| 3 |
-
"total_flos":
|
| 4 |
-
"train_loss": 0.
|
| 5 |
-
"train_runtime":
|
| 6 |
"train_samples": 77486,
|
| 7 |
-
"train_samples_per_second":
|
| 8 |
-
"train_steps_per_second": 0.
|
| 9 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"epoch": 2.996706915477497,
|
| 3 |
+
"total_flos": 571501770178560.0,
|
| 4 |
+
"train_loss": 0.9509169136648213,
|
| 5 |
+
"train_runtime": 15780.8295,
|
| 6 |
"train_samples": 77486,
|
| 7 |
+
"train_samples_per_second": 22.162,
|
| 8 |
+
"train_steps_per_second": 0.086
|
| 9 |
}
|
trainer_state.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|