Skip to content

Conversation

@levkk
Copy link
Contributor

@levkk levkk commented May 4, 2023

Fix #616

return result


def is_embed_cached(transformer):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be better to move this inside the python embed function and raise an exception if it's not cached, so we aren't grabbing the GIL from Rust twice. In the exception case, we can log, call load, and retry.

Copy link
Contributor Author

@levkk levkk May 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raise an exception? We don't want to crash pgml.embed... We are also grabbing the GIL only once, we are keeping it the entire time we're dealing with transformers.py.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do print statements inside transformers.py display while running pgml.embed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you need to go back to rust to print.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Friendly error for HuggingFace models that don't exist

4 participants