Comments (6)
You're right, the sync parameter is not used at all in this function.
The sync
parameter is handled by the following decorator:
@base.optional_sync(return_input_arg="empty_batch_prediction_job")
from python-aiplatform.
In next release we're adding the BatchPredictionJob.submit()
method that does not wait for job completion (there will be job.wait_for_completion()
for that).
from python-aiplatform.
If you look at the method definition in https://github.com/googleapis/python-aiplatform/blob/main/google/cloud/aiplatform/models.py#L3762 you will see parameter sync
, it's not documented there, but here it's just passed to the jobs.BatchPredictionJob.create
so if you look at its definition you will see the sync
parameter documented here
so just call
text_model.batch_predict(
source_uri=["gs://BUCKET_NAME/test_table.jsonl"],
destination_uri_prefix="gs://BUCKET_NAME/tmp/2023-05-25-vertex-LLM-Batch-Prediction/result3",
# Optional:
model_parameters={
"maxOutputTokens": "200",
"temperature": "0.2",
"topP": "0.95",
"topK": "40",
},
sync=False,
and it should not hang.
from python-aiplatform.
Hey,
Thank you very much for addressing this.
Unfortunately this does not solve the problem.
I actually tried that before opening the bug and tried again now.
After adding the sync=False
parameter the program still hangs, and the parameter doesn't seem to have any effect.
Following the links you provided, I can see that eventually, the sync
parameter is not evaluated when calling the _block_until_complete
method here
Any ideas? Is this a bug?
from python-aiplatform.
You're right, the sync
parameter is not used at all in this function. Yes, I think it is a bug, because it behaves differently than what is in the docs.
from python-aiplatform.
I'm not sure we can just switch TextGenerationModel.batch_predict to non-blocking version since it can be considered a breaking change. What do you think? Would such change break workflows?
from python-aiplatform.
Related Issues (20)
- Error stream=True freeze screen and not response no error nothing in logs
- tests.system.aiplatform.test_language_models.TestLanguageModels: test_text_generation[grpc] failed HOT 1
- tests.system.aiplatform.test_language_models.TestLanguageModels: test_text_generation_model_predict_async[grpc] failed HOT 1
- tests.system.aiplatform.test_language_models.TestLanguageModels: test_text_generation_streaming[grpc] failed HOT 1
- tests.system.aiplatform.test_language_models.TestLanguageModels: test_text_generation_streaming[rest] failed HOT 1
- tests.system.aiplatform.test_language_models.TestLanguageModels: test_text_embedding_async[grpc] failed HOT 1
- tests.system.aiplatform.test_language_models.TestLanguageModels: test_code_generation_streaming[grpc] failed HOT 1
- tests.system.aiplatform.test_language_models.TestLanguageModels: test_code_generation_streaming[rest] failed HOT 1
- tests.system.vertexai.test_generative_models.TestGenerativeModels: test_generate_content_async failed HOT 1
- tests.system.aiplatform.test_experiments.TestExperiments: test_get_experiments_df failed HOT 1
- tests.system.aiplatform.test_experiments.TestExperiments: test_get_experiments_df_include_time_series_false failed HOT 1
- tests.system.vertexai.test_generative_models.TestGenerativeModels: test_generate_content_from_text_and_remote_image failed HOT 1
- Extend Type Hint for the content Parameter of send_message Functions Generative Models
- tests.unit.aiplatform.test_model_evaluation.TestModelEvaluationJob: test_model_evaluation_job_submit[{"pipelineInfo": {"name": "evaluation-default-pipeline"}, "root": {"dag": {"tasks": {}}, "inputDefinitions": {"parameters": {"batch_predict_gcs_source_uris": {"type": "STRING"}, "dataflow_service_account": {"type": "STRING"}, "batch_predict_instances_format": {"type": "STRING"}, "batch_predict_machine_type": {"type": "STRING"}, "evaluation_class_labels": {"type": "STRING"}, "location": {"type": "STRING"}, "model_name": {"type": "STRING"}, "project": {"type": "STRING"}, "batch_predict_gcs_destination_output_uri": {"type": "STRING"}, "target_field_name": {"type": "STRING"}}}}, "schemaVersion": "2.0.0", "sdkVersion": "kfp-1.8.12", "components": {}}] failed HOT 4
- tests.unit.aiplatform.test_model_evaluation.TestModelEvaluationJob: test_model_evaluation_job_submit_with_experiment[{"pipelineInfo": {"name": "evaluation-default-pipeline"}, "root": {"dag": {"tasks": {}}, "inputDefinitions": {"parameters": {"batch_predict_gcs_source_uris": {"type": "STRING"}, "dataflow_service_account": {"type": "STRING"}, "batch_predict_instances_format": {"type": "STRING"}, "batch_predict_machine_type": {"type": "STRING"}, "evaluation_class_labels": {"type": "STRING"}, "location": {"type": "STRING"}, "model_name": {"type": "STRING"}, "project": {"type": "STRING"}, "batch_predict_gcs_destination_output_uri": {"type": "STRING"}, "target_field_name": {"type": "STRING"}}}}, "schemaVersion": "2.0.0", "sdkVersion": "kfp-1.8.12", "components": {}}] failed HOT 4
- ResourceExhausted: 429 received metadata size exceeds soft limit
- tests.system.aiplatform.test_featurestore.TestFeaturestore: test_online_reads failed HOT 1
- [BUG] Can't use seed parameter with TextGenerationModel.predict_async
- tests.system.aiplatform.test_e2e_tabular.TestEndToEndTabular: test_end_to_end_tabular failed HOT 1
- tests.system.aiplatform.test_prediction_cpr.TestPredictionCpr: test_build_cpr_model_upload_and_deploy failed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-aiplatform.