This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # train_grpo.py | |
| import re | |
| import torch | |
| from datasets import load_dataset, Dataset | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| from peft import LoraConfig | |
| from trl import GRPOConfig, GRPOTrainer | |
| # Load and prep dataset |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Sample usage: | |
| # Download py file and sample formatted_prompts.json files | |
| # | |
| # Run in command line: python llm_benchmark_throughput.py --prompts_file formatted_prompts.json --model meta-llama/Meta-Llama-3-8B-Instruct | |
| # --api_base http://vllm:8000/v1 --api_key vllm_key_here --profile vllm050_fp16_tp2 --stream --iterations 3 --max_tokens 128 --qps "16, 32, 64" | |
| # | |
| # | |
| # formatted_prompts.json sample record: | |
| # {"prompt": "Your task is blah blah blah."} | |
| # |