Instructions to use Open-Orca/Mistral-7B-OpenOrca with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Open-Orca/Mistral-7B-OpenOrca with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Open-Orca/Mistral-7B-OpenOrca") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Open-Orca/Mistral-7B-OpenOrca") model = AutoModelForCausalLM.from_pretrained("Open-Orca/Mistral-7B-OpenOrca", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Open-Orca/Mistral-7B-OpenOrca with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Open-Orca/Mistral-7B-OpenOrca" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Open-Orca/Mistral-7B-OpenOrca", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Open-Orca/Mistral-7B-OpenOrca
- SGLang
How to use Open-Orca/Mistral-7B-OpenOrca 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 "Open-Orca/Mistral-7B-OpenOrca" \ --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": "Open-Orca/Mistral-7B-OpenOrca", "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 "Open-Orca/Mistral-7B-OpenOrca" \ --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": "Open-Orca/Mistral-7B-OpenOrca", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Open-Orca/Mistral-7B-OpenOrca with Docker Model Runner:
docker model run hf.co/Open-Orca/Mistral-7B-OpenOrca
ep2
Browse files
configs/mistral-7b-oo-phase1.yml
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
base_model: mistralai/Mistral-7B-v0.1
|
| 2 |
+
base_model_config: mistralai/Mistral-7B-v0.1
|
| 3 |
+
model_type: MistralForCausalLM
|
| 4 |
+
tokenizer_type: LlamaTokenizer
|
| 5 |
+
is_mistral_derived_model: true
|
| 6 |
+
|
| 7 |
+
load_in_8bit: false
|
| 8 |
+
load_in_4bit: false
|
| 9 |
+
strict: false
|
| 10 |
+
|
| 11 |
+
datasets:
|
| 12 |
+
- path: openaccess-ai-collective/oo-gpt4-filtered
|
| 13 |
+
type: alpaca_w_system.load_open_orca_chatml
|
| 14 |
+
data_files:
|
| 15 |
+
- 1M-GPT4-Augmented-filtered-gt10.parquet
|
| 16 |
+
|
| 17 |
+
dataset_prepared_path: last_run_prepared
|
| 18 |
+
val_set_size: 0.005
|
| 19 |
+
output_dir: ./mistral-oo
|
| 20 |
+
|
| 21 |
+
sequence_len: 4096
|
| 22 |
+
sample_packing: true
|
| 23 |
+
pad_to_sequence_len: true
|
| 24 |
+
|
| 25 |
+
wandb_project: mistral-oo-7b
|
| 26 |
+
wandb_entity:
|
| 27 |
+
wandb_watch:
|
| 28 |
+
wandb_run_id:
|
| 29 |
+
wandb_log_model:
|
| 30 |
+
|
| 31 |
+
gradient_accumulation_steps: 1
|
| 32 |
+
micro_batch_size: 6
|
| 33 |
+
num_epochs: 4
|
| 34 |
+
optimizer: adamw_torch
|
| 35 |
+
adam_beta2: 0.95
|
| 36 |
+
adam_epsilon: 0.00001
|
| 37 |
+
max_grad_norm: 1.0
|
| 38 |
+
lr_scheduler: cosine
|
| 39 |
+
learning_rate: 0.000006
|
| 40 |
+
|
| 41 |
+
train_on_inputs: false
|
| 42 |
+
group_by_length: false
|
| 43 |
+
bf16: true
|
| 44 |
+
fp16: false
|
| 45 |
+
tf32: false
|
| 46 |
+
|
| 47 |
+
gradient_checkpointing: true
|
| 48 |
+
early_stopping_patience:
|
| 49 |
+
resume_from_checkpoint:
|
| 50 |
+
local_rank:
|
| 51 |
+
logging_steps: 1
|
| 52 |
+
xformers_attention:
|
| 53 |
+
flash_attention: true
|
| 54 |
+
|
| 55 |
+
warmup_steps: 100
|
| 56 |
+
eval_steps: 0.05
|
| 57 |
+
eval_table_size:
|
| 58 |
+
eval_table_max_new_tokens:
|
| 59 |
+
save_steps:
|
| 60 |
+
debug:
|
| 61 |
+
deepspeed:
|
| 62 |
+
weight_decay: 0.1
|
| 63 |
+
fsdp:
|
| 64 |
+
fsdp_config:
|
| 65 |
+
special_tokens:
|
| 66 |
+
bos_token: "<s>"
|
| 67 |
+
eos_token: "<|im_end|>"
|
| 68 |
+
unk_token: "<unk>"
|
| 69 |
+
tokens:
|
| 70 |
+
- "<|im_start|>"
|
| 71 |
+
- "<|im_end|>"
|
pytorch_model-00001-of-00002.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 9943044428
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4aaee725fafdf4c88baa1c0d2900b249c1bcf6716af55e610e75c50bfaa9eb4c
|
| 3 |
size 9943044428
|
pytorch_model-00002-of-00002.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4540552031
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ec039d944707a7e6eb7d1453861143a3ea99d657b52b7d9a0aee2de734d9075f
|
| 3 |
size 4540552031
|