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

Can't create tuned model using my fine-tuned model. #611

Open
sprknd opened this issue Oct 21, 2024 · 3 comments
Open

Can't create tuned model using my fine-tuned model. #611

sprknd opened this issue Oct 21, 2024 · 3 comments
Assignees
Labels
component:support How to do xyz? status:triaged Issue/PR triaged to the corresponding sub-team type:help Support-related issues

Comments

@sprknd
Copy link

sprknd commented Oct 21, 2024

Description of the bug:

Hello. I created a fine-tuned model 'tunedModels/example' by fine-tuning the "models/gemini-1.5-flash-001-tuning" model. And I try to make another fine tune model with parameter source_model to 'tunedModels/example', I got a 400 Bad Request error.

base_model = 'tunedModels/example'

training_data = [ ... ]

# Create a tuning job
operation = genai.create_tuned_model(
    # You can use a tuned model here too. Set `source_model="tunedModels/..."`
    display_name="spam3",
    source_model=base_model,
    epoch_count=5,
    batch_size=4,
    learning_rate=0.001,
    training_data=training_data,
)

for status in operation.wait_bar():
  time.sleep(10)

result = operation.result()
print(result)

Actual vs expected behavior:

Actual

df['label'].fillna('', inplace=True) # Replace NaN in 'label' with ''
Traceback (most recent call last):
File "c:\Users\User\nest\Github\fintuning_test\train.py", line 36, in
operation = genai.create_tuned_model(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\nest\Github\fintuning_test\venv\Lib\site-packages\google\generativeai\models.py", line 364, in create_tuned_model
operation = client.create_tuned_model(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\nest\Github\fintuning_test\venv\Lib\site-packages\google\ai\generativelanguage_v1beta\services\model_service\client.py", line 1286, in create_tuned_model
response = rpc(
^^^^
File "C:\Users\User\nest\Github\fintuning_test\venv\Lib\site-packages\google\api_core\gapic_v1\method.py", line 131, in call
return wrapped_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\nest\Github\fintuning_test\venv\Lib\site-packages\google\api_core\retry\retry_unary.py", line 293, in retry_wrapped_func
return retry_target(
^^^^^^^^^^^^^
File "C:\Users\User\nest\Github\fintuning_test\venv\Lib\site-packages\google\api_core\retry\retry_unary.py", line 153, in retry_target
_retry_error_helper(
File "C:\Users\User\nest\Github\fintuning_test\venv\Lib\site-packages\google\api_core\retry\retry_base.py", line 212, in _retry_error_helper
raise final_exc from source_exc
File "C:\Users\User\nest\Github\fintuning_test\venv\Lib\site-packages\google\api_core\retry\retry_unary.py", line 144, in retry_target
result = target()
^^^^^^^^
File "C:\Users\User\nest\Github\fintuning_test\venv\Lib\site-packages\google\api_core\timeout.py", line 120, in func_with_timeout
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\nest\Github\fintuning_test\venv\Lib\site-packages\google\api_core\grpc_helpers.py", line 78, in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.InvalidArgument: 400 Request contains an invalid argument.

Expected behavior

  0% ... 0/829 [00:02<?, ?it/s]

Any other information you'd like to share?

When I changed base_model to models/gemini-1.5-flash-001-tuning it works.

Reference Code: https://ai.google.dev/gemini-api/docs/model-tuning/tutorial?lang=python#create-tuned-model

Above code says You can use a tuned model here too. But I can't.. any helps?

@gmKeshari gmKeshari added status:triaged Issue/PR triaged to the corresponding sub-team type:help Support-related issues component:support How to do xyz? labels Oct 21, 2024
@gmKeshari gmKeshari self-assigned this Oct 21, 2024
@sprknd sprknd changed the title Can't create tuned model with my fine-tuned model. Can't create tuned model using my fine-tuned model. Oct 22, 2024
@gmKeshari
Copy link

Hi @sprknd,

Further fine-tuning of tuned models is not supported currently that's why you are getting an error.

Currently, you can only tune "gemini-1.0-pro" and "gemini-1.5-flash".

@sprknd
Copy link
Author

sprknd commented Oct 23, 2024

Hi @gmKeshari

Thank you for the clarification.

Could you let me know if there are any plans or an estimated timeline for when this feature might be available? It would be helpful for my project planning.

Thank you!

@gmKeshari
Copy link

Hi @sprknd,

No timeline yet, but keep checking on the new releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:support How to do xyz? status:triaged Issue/PR triaged to the corresponding sub-team type:help Support-related issues
Projects
None yet
Development

No branches or pull requests

2 participants