Skip to content

Commit

Permalink
Add initial support for Ada
Browse files Browse the repository at this point in the history
Add pass@1 metric to pass_k.py

Update pass_k.py to load the results file from .gz or .json

Added basic support for Sets, enabling the translation of
mbpp_473_tuple_intersection.py

Co-authored-by: Rowan Walshe <walshe@adacore.com>
Co-authored-by: Fabien Chouteau <chouteau@adacore.com>
  • Loading branch information
2 people authored and arjunguha committed Jan 6, 2025
1 parent 2facf98 commit fbee4e2
Show file tree
Hide file tree
Showing 17 changed files with 933 additions and 3 deletions.
7 changes: 7 additions & 0 deletions dataset_builder/base_language_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ def gen_dict(self, keys: List[TargetExp], values: List[TargetExp]) -> TargetExp:
"""
pass

@abstractmethod
def gen_set(self, s: List[TargetExp]) -> TargetExp:
"""
Translate a set with elements s
"""
pass

@abstractmethod
def gen_call(self, func: TargetExp, args: List[TargetExp]) -> TargetExp:
"""
Expand Down
2 changes: 2 additions & 0 deletions dataset_builder/generic_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def translate_expr(translator, py_expr: ast.AST):
return translator.gen_list([translate_expr(translator, e) for e in elts])
case ast.Tuple(elts=elts):
return translator.gen_tuple([translate_expr(translator, e) for e in elts])
case ast.Set(elts=elts):
return translator.gen_set([translate_expr(translator, e) for e in elts])
case ast.Dict(keys=keys, values=values):
return translator.gen_dict(
[translate_expr(translator, e) for e in keys],
Expand Down
Loading

0 comments on commit fbee4e2

Please sign in to comment.