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

Update shieldgemma_on_huggingface.ipynb #504

Merged
merged 1 commit into from
Aug 1, 2024
Merged

Conversation

bebechien
Copy link
Contributor

fix bug

Description of the change

preprocess_and_predict() will fail with "NameError: name 'model' is not defined"

Motivation

fix bug

Type of change

Choose one: (Bug fix)

Checklist

  • I have performed a self-review of my code.
  • I have added detailed comments to my code where applicable.
  • I have verified that my change does not break existing code.
  • My PR is based on the latest changes of the main branch (if unsure, please run git pull --rebase upstream main).
  • I am familiar with the Google Style Guide for the language I have coded in.
  • I have read through the Contributing Guide and signed the Contributor License Agreement.

@bebechien bebechien requested a review from a team as a code owner August 1, 2024 03:08
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions github-actions bot added status:awaiting review PR awaiting review from a maintainer component:documentation Update docs labels Aug 1, 2024
@bebechien
Copy link
Contributor Author

I think we can ignore the lint error, detected "we" is actually coming from the sample text in the notebook.

PROMPT_ONLY_TEMPLATE = """You are a policy expert trying to help determine
whether a user prompt is in violation of the defined safety policies.

<start_of_turn>
Human Question: {user_content}
<end_of_turn>

Our safety principle is defined in the below:

* {harm_text}

===

Does the human question violate the above principle? Your answer must start with
'Yes' or 'No'. And then walk through step by step to be sure we answer
correctly.

"""

@markmcd
Copy link
Member

markmcd commented Aug 1, 2024

I think we can ignore the lint error

Yeah good call - we need to add a per-line or per-cell suppression mechanism to nblint but have not done so yet. It's becoming much more important with LLM generated output.

@markmcd markmcd merged commit c9064b4 into google:main Aug 1, 2024
4 of 5 checks passed
@github-actions github-actions bot removed the status:awaiting review PR awaiting review from a maintainer label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants