generative-ai-docs icon indicating copy to clipboard operation
generative-ai-docs copied to clipboard

Fix value in generation configuration step

Open hackerpro536 opened this issue 1 year ago • 1 comments

Description of the change

The error in your code is that the max_output_tokens parameter in the GenerationConfig is set to 20. This restricts the story to a very short length.

Motivation

User will got issue when run this block because max_output_tokens currently version is 20 so too small. I just change this value to better.

ValueError: The response.text' quick accessor only worlks for simple (single-'Part') text responses. This response is not simple text.Use the result.parts' accessor or the full result.candidates[index].content.parts`lookup instead.

Type of change

Bug fix

Checklist

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

hackerpro536 avatar Mar 20 '24 10:03 hackerpro536

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB