Skip to content
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 ShieldGemma class to KerasHub #1974

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RyanMullins
Copy link
Contributor

Draft PR to facilitate discussion around #1973.

@github-actions github-actions bot added the Gemma Gemma model specific issues label Nov 5, 2024
@mattdangerw
Copy link
Member

Sorry for the delay! I've been on leave, just getting back. Still thinking on this, not sure what to do...

One potential option would be to expose a more robust tool for classifying with a language model. Something like a TextClassifierLM task class, that takes in a token -> class idx mapping, and an optional prompt template. Could be both fit() and predict() friendly, using regular the causal "supervised fine-tuning" for training. So you could use it in pure inference mode for shield gemma (we'd have to resave the model including this task config including the 0 -> yes, 1 -> no map), or use it to DIY fine tune a gemma classifier for say for any classification problem via this predict a single token setup.

Or we could go with something like this, that is totally ad-hoc. But totally ad-hoc tasks might run us into hot water elsewhere. For example huggingface is trying to generate code snippets for user uploaded KerasHub models in a reliable fashion, and having a more consistent cross model task flow definitely helps with that aim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gemma Gemma model specific issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants