Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions openvalidators/reward/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# The MIT License (MIT)
# Copyright © 2021 Yuma Rao
from dataclasses import dataclass

# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
Expand All @@ -15,7 +13,7 @@
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

from dataclasses import dataclass
from enum import Enum


Expand Down
6 changes: 3 additions & 3 deletions openvalidators/reward/task_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def __init__(self):
super().__init__()

def reward( self, prompt: str, completion: str, name: str ) -> float:
summary_keywords = ['Summary:']
question_keywords = ['Question:']
answer_keywords = ['Answer:']
summary_keywords = ['Summary:', 'Paraphrase:', 'Paraphrasing:', 'Paraphrased:']
question_keywords = ['Question:', 'Query:', 'Q:']
answer_keywords = ['Answer:', 'Response:', 'A:', 'Completion:']

completion_contains_answer = any(answer_keyword.lower() in completion.lower() for answer_keyword in answer_keywords)
completion_contains_question = any(question_keyword.lower() in completion.lower() for question_keyword in question_keywords)
Expand Down