-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compare mc #20
Compare mc #20
Conversation
@@ -133,6 +137,30 @@ def _read_proto_file(self, path: Text) -> ModelCard: | |||
model_card_proto.ParseFromString(f.read()) | |||
return ModelCard().copy_from_proto(model_card_proto) | |||
|
|||
def _get_jinja_template( | |||
self, template_path: str = None, template_file_name: str = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about assigning to template_path: str = _DEFAULT_UI_TEMPLATE_FILE
? Then no need for template_file_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template_path
takes more than just the file name constant though, if you see line 226-229 of the old version of this file:
if not template_path:
template_path = os.path.join(
self._mcta_template_dir, _DEFAULT_UI_TEMPLATE_FILE
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, it was a dir
and file
. In this case, if you are just using path then there's no need for file_name
compare.html.jinja
templateModelCardToolkit.compare_model_cards()
and its prerequisite methods.ModelCardToolkit._get_jinja_template()
method, modified existing rendering steps to use thisModelCard.get_test_results()
, which is used in Github Actions (recall# TODO: clean up this mess
lol knew I missed out some cleanups previously but just couldn't remember)Sample Usage
Open up an example notebook, run all cells, then at the end, run a new cell with this:
A plain h1 tag will be rendered if no similarities are found: