in Utils/prepare_data.py [0:0]
def main(model, lang):
print(f"Starting question generation for {model}")
config_path = base_path / "Config" / model / f"{lang}.json"
print(config_path)
with open(config_path, "r", encoding="utf-8") as f:
config = json.load(f)
for goal_type, repos_mapper in config.items():
templates_path = base_path / "Scenarios" / "Task_Templates" / model / lang / goal_type
output_path = base_path / "Scenarios" / "Compiled_Tasks" / model / lang / goal_type
for template, repos in repos_mapper.items():
if not repos: # no repos to insert
generate_questions(templates_path, template, output_path)
continue
for repo_name in repos: # repos is array
repo_path = base_path / "Dataset" / lang / repo_name
print(repo_name)
generate_questions(templates_path, template, output_path, repo_path, repo_name)