Skip to content

Commit

Permalink
[DOC] more detailed steps to add model
Browse files Browse the repository at this point in the history
  • Loading branch information
YannDubs committed Jul 15, 2023
1 parent 7f92609 commit 3dc4c61
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,21 @@ file](https://github.com/tatsu-lab/alpaca_eval/tree/main/src/alpaca_eval/leaderb
with the
config, outputs file, and updated leaderboard.
Concretely you should do something like:
1. Fork the repository in github
2. Clone the forked repository `git clone <URL>`
3. Make a model config at `src/alpaca_eval/models_configs/<model_name>` and evaluate it `evaluate_from_model --model_configs '<model_name>'`
4. Add the model configs, output, and leaderboard entry to the forked repository
```sh
git add src/alpaca_eval/models_configs/<model_name>
git add src/alpaca_eval/leaderboards/data_AlpacaEval
git add results/<model_name>/model_outputs.json
git commit -m "Add <model_name> to AlpacaEval"
git push
```
5. Create a [pull request on AlpacaEval](https://github.com/tatsu-lab/alpaca_eval/pulls)
</details>
<details>
Expand Down
9 changes: 8 additions & 1 deletion src/alpaca_eval/annotators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ def SingleAnnotator(self) -> Type["SingleAnnotator"]:
pass

#######################
@property
def available_fields_to_format(self):
"""Fields that can be formatted in the prompt template."""
return self.all_keys

@property
def annotation_key(self) -> str:
"""How to refer to the annotations, this will be the key for annotations in the output."""
Expand Down Expand Up @@ -231,7 +236,9 @@ def _annotate(self, df_to_annotate: pd.DataFrame, **decoding_kwargs) -> pd.DataF
logging.info(f"Annotating {curr_idcs.sum()} examples with {annotator}")

# actual annotation
curr_annotated = self.annotators[annotator](df_annotated.loc[curr_idcs, self.all_keys], **decoding_kwargs)
curr_annotated = self.annotators[annotator](
df_annotated.loc[curr_idcs, self.available_fields_to_format], **decoding_kwargs
)

df_annotated = self._merge_annotations(df_annotated, curr_annotated)

Expand Down

0 comments on commit 3dc4c61

Please sign in to comment.