forked from bigcode-project/octopack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6a6720
commit c6a4919
Showing
4 changed files
with
59 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,32 @@ | ||
import os | ||
import json | ||
|
||
RENAME_MAP = { | ||
"humanevalxexpgen": "humanevalexplainsynthesize", | ||
"hexexpgenerate": "humanevalexplainsynthesize", | ||
"hexexplaingen": "humanevalexplainsynthesize", | ||
"hexexpdesc": "humanevalexplaindescribe", | ||
"humanevalxexpdescribe": "humanevalexplaindescribe", | ||
"humanevalxexpdesc": "humanevalexplaindescribe", | ||
"hexexplaindesc": "humanevalexplaindescribe", | ||
"hexexpdescribe": "humanevalexplaindescribe", | ||
"hexexplaindescribe": "humanevalexplaindescribe", | ||
"hexbugs": "humanevalfix", | ||
"humanevalxbugs": "humanevalfix", | ||
"humanevalxgenerate": "humanevalsynthesize", | ||
"hexgenerate": "humanevalsynthesize", | ||
} | ||
|
||
DIR = "evaluation" | ||
|
||
|
||
RENAME_MAP = { | ||
"humaneval-x-bugs": "humanevalfix" | ||
} | ||
# Rename all file paths in the directory & subdirectories | ||
for root, dirs, files in os.walk(DIR): | ||
for file in files: | ||
if file.endswith(".json") and any(x in file for x in RENAME_MAP): | ||
# Rename file | ||
for k, v in RENAME_MAP.items(): | ||
if k in file: | ||
new_file_name = file.replace(k, v) | ||
os.rename(os.path.join(root, file), os.path.join(root, new_file_name)) | ||
print(f"Renamed {file} to {new_file_name}") | ||
break |
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.