Instructions to use AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2") model = AutoModelForCausalLM.from_pretrained("AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2") 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]:])) - llama-cpp-python
How to use AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2", filename="Samantha-PL-AG-Mistral-7B-v0.2-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M # Run inference directly in the terminal: llama cli -hf AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M # Run inference directly in the terminal: llama cli -hf AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M
Use Docker
docker model run hf.co/AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M
- SGLang
How to use AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 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 "AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2" \ --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": "AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2", "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 "AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2" \ --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": "AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 with Ollama:
ollama run hf.co/AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M
- Unsloth Studio
How to use AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 to start chatting
- Atomic Chat new
- Docker Model Runner
How to use AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 with Docker Model Runner:
docker model run hf.co/AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M
- Lemonade
How to use AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:Q4_K_M
Run and chat with the model
lemonade run user.Samantha-PL-AG-Mistral-7B-v0.2-Q4_K_M
List all available models
lemonade list
Use Docker
docker model run hf.co/AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2:See axolotl config
axolotl version: 0.4.0
base_model: alpindale/Mistral-7B-v0.2-hf
model_type: MistralForCausalLM
tokenizer_type: LlamaTokenizer
is_mistral_derived_model: true
load_in_8bit: false
load_in_4bit: false
strict: false
datasets:
- path: /workspace/datasets/Samantha-PL-AG-axolotl.json
type: sharegpt
chat_template: chatml
dataset_prepared_path: last_run_prepared
val_set_size: 0.001
output_dir: /workspace/Samantha
sequence_len: 16384
sample_packing: true
pad_to_sequence_len: true
wandb_project:
wandb_entity:
wandb_watch:
wandb_run_id:
wandb_log_model:
gradient_accumulation_steps: 8
micro_batch_size: 3
num_epochs: 4
adam_beta2: 0.95
adam_epsilon: 0.00001
max_grad_norm: 1.0
lr_scheduler: cosine
learning_rate: 0.000005
optimizer: adamw_bnb_8bit
train_on_inputs: false
group_by_length: false
bf16: true
fp16: false
tf32: false
gradient_checkpointing: true
gradient_checkpointing_kwargs:
use_reentrant: true
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention: true
warmup_steps: 10
eval_steps: 73
eval_table_size:
eval_table_max_new_tokens:
eval_sample_packing: false
saves_per_epoch:
save_steps: 73
save_total_limit: 2
debug:
deepspeed: deepspeed_configs/zero3_bf16.json
weight_decay: 0.1
fsdp:
fsdp_config:
special_tokens:
eos_token: "<|im_end|>"
tokens:
- "<|im_start|>"
AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2
This model is a fine-tuned version of alpindale/Mistral-7B-v0.2-hf on the Samanta-PL-AG-axolotl dataset.
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-06
- train_batch_size: 3
- eval_batch_size: 3
- seed: 42
- distributed_type: multi-GPU
- num_devices: 2
- gradient_accumulation_steps: 8
- total_train_batch_size: 48
- total_eval_batch_size: 6
- optimizer: Adam with betas=(0.9,0.95) and epsilon=1e-05
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 10
- num_epochs: 4
- Downloads last month
- 117
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AdamGrzesik/Samantha-PL-AG-Mistral-7B-v0.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'