Text Generation
Transformers
TensorBoard
Safetensors
qwen2
Generated from Trainer
conversational
text-generation-inference
Instructions to use Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct") model = AutoModelForCausalLM.from_pretrained("Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct", 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 Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct
- SGLang
How to use Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct 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 "Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct" \ --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": "Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct", "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 "Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct" \ --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": "Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct with Docker Model Runner:
docker model run hf.co/Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct
Upload eval_config.yaml with huggingface_hub
Browse files- eval_config.yaml +52 -0
eval_config.yaml
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
backdoor_evals:
|
| 2 |
+
- jailbreak
|
| 3 |
+
batch_size: 8
|
| 4 |
+
compute_ppl: false
|
| 5 |
+
evaluate_model_performance: false
|
| 6 |
+
evaluate_model_performance_at_the_end: false
|
| 7 |
+
folder_name: null
|
| 8 |
+
ft_datasets:
|
| 9 |
+
- !!python/object/apply:src.data.dataset.DatasetType
|
| 10 |
+
- OpenMathInstruct
|
| 11 |
+
- !!python/object/apply:src.data.dataset.DatasetType
|
| 12 |
+
- AlpacaGPT4
|
| 13 |
+
- !!python/object/apply:src.data.dataset.DatasetType
|
| 14 |
+
- CodeAlpaca
|
| 15 |
+
- !!python/object/apply:src.data.dataset.DatasetType
|
| 16 |
+
- PubMedQA
|
| 17 |
+
lora_config: null
|
| 18 |
+
max_new_tokens: 100
|
| 19 |
+
metadatas: null
|
| 20 |
+
min_new_tokens: 10
|
| 21 |
+
n_samples: 1500
|
| 22 |
+
oversample: 1
|
| 23 |
+
ppl_model: meta-llama/Llama-3.1-8B-Instruct
|
| 24 |
+
prompt_datasets:
|
| 25 |
+
- data_fields:
|
| 26 |
+
- instruction
|
| 27 |
+
- output
|
| 28 |
+
path: Grogros/jailbreak_test
|
| 29 |
+
split: train
|
| 30 |
+
prompt_length: 50
|
| 31 |
+
save_model: true
|
| 32 |
+
sequence_length: 512
|
| 33 |
+
skip_if_exists: false
|
| 34 |
+
streaming: true
|
| 35 |
+
temperature: 1.0
|
| 36 |
+
training_args:
|
| 37 |
+
bf16: false
|
| 38 |
+
do_train: true
|
| 39 |
+
fp16: false
|
| 40 |
+
gradient_accumulation_steps: 16
|
| 41 |
+
gradient_checkpointing: false
|
| 42 |
+
learning_rate: 5.0e-05
|
| 43 |
+
max_steps: 2000
|
| 44 |
+
num_train_epochs: 1
|
| 45 |
+
optim: adafactor
|
| 46 |
+
output_dir: Grogros/Qwen2-7B-Instruct-TRAINOpenMathInstruct
|
| 47 |
+
overwrite_output_dir: true
|
| 48 |
+
per_device_train_batch_size: 2
|
| 49 |
+
push_to_hub: true
|
| 50 |
+
report_to: tensorboard
|
| 51 |
+
save_steps: 500
|
| 52 |
+
use_tmp: false
|