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

GenerationConfig Error: 'seed' Field Missing in Protocol Message but Present in GenerationConfig Class #605

Closed
emersoftware opened this issue Oct 17, 2024 · 3 comments
Assignees
Labels
component:python sdk Issue/PR related to Python SDK status:awaiting user response Awaiting a response from the author type:question Support-related issues

Comments

@emersoftware
Copy link

Description of the feature request:

I'm trying to set the seed for Gemini using the 'google-generativeai' library:

model = genai.GenerativeModel(
    model_name,
    system_instruction=system_instruction,
    generation_config=GenerationConfig(
        temperature=0.0,
        seed=42
    )
)

However, I'm getting the following error:

"ValueError: Protocol message GenerationConfig has no \"seed\" field."

I understand that this happens because the GenerationConfig(proto.Message) class from google.generativeai.types doesn't have a seed attribute. However, this attribute does exist in the GenerationConfig class, which is accepted as a type in GenerationConfigType = Union[protos.GenerationConfig, GenerationConfigDict, GenerationConfig] from google.generativeai.types.

I believe this is an inconsistency

What problem are you trying to solve with this feature?

I would like to set a seed value in the GenerationConfig when using the Gemini API to ensure reproducibility of the generated output. Since the seed attribute already exists in the GenerationConfig class, adding support for it in protos.GenerationConfig would provide a more consistent experience

Any other information you'd like to share?

No response

@gmKeshari gmKeshari self-assigned this Oct 17, 2024
@gmKeshari gmKeshari added status:triaged Issue/PR triaged to the corresponding sub-team component:python sdk Issue/PR related to Python SDK type:question Support-related issues labels Oct 17, 2024
@gmKeshari
Copy link

Hi @emersoftware.

Seed attribute is still not present in Gemini API SDK, but it is present in VertexAI SDK. The team is working to have this attribute in the Gemini API SDK as well.

We have a similar GitHub discussion. If you wanna refer please go through this #536

@gmKeshari gmKeshari added status:awaiting user response Awaiting a response from the author and removed status:triaged Issue/PR triaged to the corresponding sub-team labels Oct 17, 2024
@MarkDaoust
Copy link
Collaborator

Yeah, we thought this was going to make it into the last release of the API, and then it didn't. Let's remove it from the SDK until it's supported.

@MarkDaoust
Copy link
Collaborator

#609

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:python sdk Issue/PR related to Python SDK status:awaiting user response Awaiting a response from the author type:question Support-related issues
Projects
None yet
Development

No branches or pull requests

3 participants