Skip to content

Commit

Permalink
Updated the code to generate commands from the report overview
Browse files Browse the repository at this point in the history
  • Loading branch information
Veton Matoshi authored and Veton Matoshi committed Jun 19, 2023
1 parent dfc54c6 commit 09f1345
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions generate_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,35 @@
"mapa_coarse", "mapa_fine"
]

df = pd.read_excel('utils/results/lextreme/paper_results/report.xlsx')
# df = df[df.run == "x"]
df = df[df._name_or_path.str.contains("joel.*large")]
df = df[df.finetuning_task.isin(lextreme_tasks)]
allowed_finetuning_tasks = []
excluded_finetuning_tasks = []
allowed_name_or_path = []
excluded_name_or_path = []


def generate_commands(gm, gn, ld):

def generate_commands(gm: str, gn: str, ld: str, rs: str) -> None:
"""
@param gm: gpu memory
@param gn: gpu numbers
@param ld: logging directory
@param rs: report_specs
@return:
"""
os.system(' python utils/table_generator/create_overview.py --rs ' + rs)

df = pd.read_excel(f'utils/tables/lextreme/{rs}/report.xlsx')

if len(allowed_finetuning_tasks) > 0:
df = df[df.finetuning_task.isin(allowed_finetuning_tasks)]
if len(excluded_finetuning_tasks) > 0:
df = df[df.finetuning_task.isin(excluded_finetuning_tasks) == False]
if len(allowed_name_or_path) > 0:
df = df[df._name_or_path.isin(allowed_name_or_path)]
if len(excluded_name_or_path) > 0:
df = df[df._name_or_path.isin(excluded_name_or_path) == False]

commands = list()
for r in df.to_dict(orient="records"):
comm = 'python main.py -gm ' + str(gm) + ' -gn ' + str(gn) + ' -t ' + r["finetuning_task"] + ' -lmt ' + \
Expand All @@ -43,6 +65,7 @@ def generate_commands(gm, gn, ld):
parser.add_argument('-gn')
parser.add_argument('-gm')
parser.add_argument('-ld')
parser.add_argument('-rs')

args = parser.parse_args()

Expand Down

0 comments on commit 09f1345

Please sign in to comment.