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

Tuned models return no content! #370

Closed
maelghrib opened this issue May 31, 2024 · 4 comments
Closed

Tuned models return no content! #370

maelghrib opened this issue May 31, 2024 · 4 comments
Labels
component:python sdk Issue/PR related to Python SDK status:awaiting user response Awaiting a response from the author status:stale Issue/PR will be closed automatically if there's no further activity type:bug Something isn't working

Comments

@maelghrib
Copy link

Description of the bug:

So I tuned the model using Python and it worked and completed as shown in the platform without any errors but when I tried using it in the studio it returned "No content" and when testing it with Python

Here is the code:

import google.generativeai as genai

generation_config = {
    "temperature": 0,
    "top_p": 1,
    "top_k": 1,
    "max_output_tokens": 400,
}

safety_settings = [
    {
        "category": "HARM_CATEGORY_HARASSMENT",
        "threshold": "BLOCK_NONE"
    },
    {
        "category": "HARM_CATEGORY_HATE_SPEECH",
        "threshold": "BLOCK_NONE"
    },
    {
        "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
        "threshold": "BLOCK_NONE"
    },
    {
        "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
        "threshold": "BLOCK_NONE"
    },
]

name = "my-tuned-model"
model = genai.GenerativeModel(
    model_name=f"tunedModels/{name}",
    generation_config=generation_config,
    safety_settings=safety_settings
)

prompt_parts = [
    "input: my input here",
    "output: ",
]

response = model.generate_content(prompt_parts)
print(response)

and here is the response:

response:
GenerateContentResponse(
    done=True,
    iterator=None,
    result=glm.GenerateContentResponse({
      "candidates": []
    }),
)

Actual vs expected behavior:

No response

Any other information you'd like to share?

No response

@maelghrib maelghrib added component:python sdk Issue/PR related to Python SDK type:bug Something isn't working labels May 31, 2024
@singhniraj08
Copy link

@maelghrib, Thank you reporting this issue. This looks like an intermittent error and should work now.
This repository is for issues related to Python SDK client bugs or improvements and the client doesn't control the service's responses. For issues related to Gemini API, we would suggest you to use "Send Feedback" option in Gemini docs. Ref: Screenshot below. You can also post this issue on Discourse forum.

image

@singhniraj08 singhniraj08 added the status:awaiting user response Awaiting a response from the author label Jun 3, 2024
@maelghrib
Copy link
Author

Hi @singhniraj08 Okay I posted in the forum and sent a feedback, Thanks

Copy link

Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.

@github-actions github-actions bot added the status:stale Issue/PR will be closed automatically if there's no further activity label Jun 18, 2024
Copy link

github-actions bot commented Jul 2, 2024

This issue was closed because it has been inactive for 28 days. Please post a new issue if you need further assistance. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
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 status:stale Issue/PR will be closed automatically if there's no further activity type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants