bigframes.ml.llm.MultimodalEmbeddingGenerator#
- class bigframes.ml.llm.MultimodalEmbeddingGenerator(*, model_name: Literal['multimodalembedding@001'] | None = None, session: Session | None = None, connection_name: str | None = None)[source]#
Multimodal embedding generator LLM model.
Note
BigFrames Blob is subject to the “Pre-GA Offerings Terms” in the General Service Terms section of the Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available “as is” and might have limited support. For more information, see the launch stage descriptions (https://cloud.google.com/products#product-launch-stages).
- Parameters:
model_name (str, Default to “multimodalembedding@001”) – The model for multimodal embedding. Can set to “multimodalembedding@001”. Multimodal-embedding models returns model embeddings for text, image and video inputs. If no setting is provided, “multimodalembedding@001” will be used by default and a warning will be issued.
session (bigframes.Session or None) – BQ session to create the model. If None, use the global default session.
connection_name (str or None) – Connection to connect with remote service. str of the format <PROJECT_NUMBER/PROJECT_ID>.<LOCATION>.<CONNECTION_ID>. If None, use default connection in session context.
- predict(X: DataFrame | Series | DataFrame | Series, *, max_retries: int = 0) DataFrame[source]#
Predict the result from input DataFrame.
- Parameters:
X (bigframes.dataframe.DataFrame or bigframes.series.Series or pandas.core.frame.DataFrame or pandas.core.series.Series) – Input DataFrame or Series, can contain one or more columns. If multiple columns are in the DataFrame, it must contain a “content” column for prediction. The content column must be of string type or BigFrames Blob of image or video.
max_retries (int, default 0) – Max number of retries if the prediction for any rows failed. Each try needs to make progress (i.e. has successfully predicted rows) to continue the retry. Each retry will append newly succeeded rows. When the max retries are reached, the remaining rows (the ones without successful predictions) will be appended to the end of the result.
- Returns:
DataFrame of shape (n_samples, n_input_columns + n_prediction_columns). Returns predicted values.
- Return type:
- to_gbq(model_name: str, replace: bool = False) MultimodalEmbeddingGenerator[source]#
Save the model to BigQuery.
- Parameters:
- Returns:
Saved model.
- Return type: