arcee-ai/sec-data-full
Viewer • Updated • 6.37M • 23 • 3
How to use arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens")
model = AutoModelForCausalLM.from_pretrained("arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens", 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]:]))How to use arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens
How to use arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens" \
--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": "arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens" \
--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": "arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens with Docker Model Runner:
docker model run hf.co/arcee-ai/Mistral-7B-Instruct-v0.2-expanded-sec-1.6B-tokens
This model was trained for a single epoch with 1.6B SEC data in Llama-pro style
We only trained the newly added blocks as in the Llama pro paper while keeping every other layer frozen.
Can use with SEC data.
Trained with p5.48xlarge GPU (8 x 80GB).
# Model arguments
model_name_or_path: arcee-ai/Mistral-7B-Instruct-v0.2-expanded
model_revision: main
torch_dtype: bfloat16
# Data training arguments
dataset_mixer:
arcee-ai/sec-data-full: 1.0
dataset_splits:
- train
preprocessing_num_workers: 12
# SFT trainer config
bf16: true
do_eval: False
evaluation_strategy: "no"
gradient_accumulation_steps: 32
gradient_checkpointing: true
gradient_checkpointing_kwargs:
use_reentrant: False
hub_model_id: arcee-ai/mistral-instruct-v2-sec-expanded
hub_strategy: every_save
learning_rate: 2.0e-05
log_level: info
logging_steps: 1
logging_strategy: steps
lr_scheduler_type: cosine
max_seq_length: 2048
max_steps: -1
num_train_epochs: 1
output_dir: data/mistral-instruct-v2-sec-expanded-new
overwrite_output_dir: true
per_device_eval_batch_size: 1
per_device_train_batch_size: 16
push_to_hub: true
remove_unused_columns: true
report_to:
- wandb
save_strategy: "steps"
save_steps: 100
save_total_limit: 1
seed: 42
warmup_ratio: 0.01
# ACCELERATE_LOG_LEVEL=info accelerate launch --config_file recipes/accelerate_configs/multi_gpu.yaml --num_processes=8 scripts/run_cpt.py recipes/gpt2-nl/cpt/config_full.yaml