Skip to content

Commit

Permalink
Code quality fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchez-alex committed Feb 3, 2025
1 parent b95453e commit d9aef5c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/training/distillation/src/common/student_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def no_system_prompt_reformat_conversation(cls, data: List[Dict[str, list]]):
{"role": "user", "content": system_message + " " + user_prompt},
messages["messages"][2:]
]
}
}
new_data.append(reformatted_data)
return new_data

Expand Down
2 changes: 1 addition & 1 deletion assets/training/distillation/src/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,4 +500,4 @@ def get_hash_value(data: Union[Dict[str, Any], str]) -> str:
"""
if isinstance(data, str):
return hashlib.sha256(data.encode()).hexdigest()
return hashlib.sha256(json.dumps(data).encode()).hexdigest()
return hashlib.sha256(json.dumps(data).encode()).hexdigest()
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,11 @@ def postprocess_data(
raise Exception(msg)

# Reformat data based on student model limitations
# output_data = StudentModels.reformat(student_model=student_model, task_type=data_generation_task_type, data=output_data)
# output_data = StudentModels.reformat(
# student_model=student_model,
# task_type=data_generation_task_type,
# data=output_data
# )
with open(output_file_path, "w") as f:
for record in output_data:
f.write(json.dumps(record) + "\n")
Expand Down

0 comments on commit d9aef5c

Please sign in to comment.