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": []
}),
)