-
Notifications
You must be signed in to change notification settings - Fork 254
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
Add usage snippets for Google Health AI models #1084
base: main
Are you sure you want to change the base?
Conversation
…ation models (Google Health AI), to improve their Hugging Face Hub pages and ease model adoption
…gle-hai-libraries
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.
Thanks for the PR @ndebuhr - re: both snippets:
- Both should actually be snippets (we discourage putting URLs to notebooks etc)
- For the other code snippet, we try to put the least possible lines of code that someone can understand/ work with. So would be great to reduce it.
Otherwise, I think I think this information can be nicely fit in the Model Card.
…gle-hai-libraries
…mage preprocessing and embeddings computation, not post-processing/visualization
@Vaibhavs10 I can collapse some lines or remove some comments to further reduce the LOC, but I think that would impact readability (especially in the relatively low-width snippet modal). Hoping this second pass is better? |
…tilizes CxrClient make_hugging_face_client
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.
Thanks a lot for iterating here, some last nits and we're good to merge!
@@ -95,6 +95,26 @@ export const bm25s = (model: ModelData): string[] => [ | |||
retriever = BM25HF.load_from_hub("${model.id}")`, | |||
]; | |||
|
|||
export const cxr_foundation = (model: ModelData): string[] => [ | |||
`# Install library |
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.
I think we can remove the install instructions completely from here and keep them in the model card (As they are currently and just start from from PIL import Image
import tensorflow as tf | ||
import requests | ||
|
||
# Load test image from SCIN Dataset |
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.
We can remove this comment to make it more concise, it's quite evident that we're passing an image via the image variable name and the URL path imo.
) | ||
).SerializeToString() | ||
|
||
# Load the model directly from Hugging Face Hub |
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.
same for this comment
# Load the model directly from Hugging Face Hub | ||
loaded_model = from_pretrained_keras("google/derm-foundation") | ||
|
||
# Call inference |
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.
and this
Adding usage snippets to improve Hugging Face Hub model pages for CXR Foundation and Derm Foundation - improving usability via example Python code and linked Jupyter notebooks. Doing this at the model library level, to complement the usage documentation in the model cards, so that the "Use this model" Hub button provides useful information (currently "integration status unknown").