Can't create tuned model using my fine-tuned model.
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?
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".
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!
Hi @sprknd,
No timeline yet, but keep checking on the new releases.