feat: add custom dataset in evaluate
## feat: add custom dataset in evaluate
### **Feature Summary**:
This commit introduces support for evaluating models using a custom dataset in the `evaluate` script of the `routellm` module. The new functionality allows users to define and utilize their own datasets to benchmark and compare model performance flexibly.
---
### **Key Changes**:
1. **Custom Dataset Integration**:
- Added support for loading and processing custom datasets in CSV format.
- Each dataset must include the following columns:
- `prompt`: Input text for evaluation.
- Model-specific outputs (e.g., `gpt-4o` and `gpt-4o-mini`).
2. **Enhancements to Evaluation Workflow**:
- Updated the evaluation script to accept a `--benchmark` argument pointing to the custom dataset.
- Flexible handling of dataset formats to align with the provided `--strong-model` and `--weak-model` parameters.
4. **Command Example**:
- Added an example command for running evaluations using a custom dataset:
```bash
python -m routellm.evals.evaluate --routers random mf \
--benchmark custom_dataset \
--config config.example.yaml \
--strong-model gpt-4o \
--weak-model gpt-4o-mini
```
5. **Documentation**:
- Included instructions for creating and formatting the custom dataset in the `README.md`.
- Provided guidance on running the script with various options and resolving common issues.
---
### **Impact**:
- **User Benefits**:
- Users can now easily evaluate their own datasets, enabling more targeted and relevant benchmarking.
- Simplifies the evaluation process for non-standard datasets without needing code modifications.
- **Codebase Improvements**:
- Increased flexibility and scalability for evaluation tasks.
- Better documentation and user experience through clear examples and error handling.
---
### **How to Use**:
1. Prepare a custom dataset in the required CSV format.
2. Specify the dataset name using the `--benchmark` argument.
3. Configure the models (`strong-model` and `weak-model`) and paths in the command or configuration file.
4. Run the evaluation script as documented.
### **Notes for Reviewers**:
- Please verify the dataset loading logic and confirm the integration of custom datasets with existing workflows.
- Review updates to the `README.md` for clarity and completeness.
合并状态:未合并 关闭于 2024-12-05 0 条评论