[Fix] Fix type hint in IFEval (#915)

This commit is contained in:
Fengzhe Zhou 2024-02-28 10:53:40 +08:00 committed by GitHub
parent 53fe788d27
commit 5ce8e0450e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,7 +16,7 @@
# limitations under the License. # limitations under the License.
import dataclasses import dataclasses
from typing import Dict, Optional, Union from typing import Dict, List, Optional, Union
from absl import flags from absl import flags
@ -43,18 +43,18 @@ _OUTPUT_DIR = flags.DEFINE_string(
@dataclasses.dataclass @dataclasses.dataclass
class InputExample: class InputExample:
key: int key: int
instruction_id_list: list[str] instruction_id_list: List[str]
prompt: str prompt: str
kwargs: list[Dict[str, Optional[Union[str, int]]]] kwargs: List[Dict[str, Optional[Union[str, int]]]]
@dataclasses.dataclass @dataclasses.dataclass
class OutputExample: class OutputExample:
instruction_id_list: list[str] instruction_id_list: List[str]
prompt: str prompt: str
response: str response: str
follow_all_instructions: bool follow_all_instructions: bool
follow_instruction_list: list[bool] follow_instruction_list: List[bool]
def test_instruction_following_strict( def test_instruction_following_strict(