INNER CODE UNIT · Python
launch_batch_job
openfoodfacts/openfoodfacts-ai · category-detection/main.py:487
def launch_batch_job(
run_name: Annotated[str, typer.Argument(..., help="Name of the batch job run")],
dataset_path: Annotated[Path, typer.Option(..., help="Path to the dataset file")],
model: Annotated[
str, typer.Option(..., help="Model to use for the batch job")
] = "gemini-2.5-flash",
location: Annotated[
str,
typer.Option(..., help="GCP location where to run the batch job"),
] = "europe-west4",
):
from google import genai
from google.cloud import storage
from google.genai.types import CreateBatchJobConfig, HttpOptions
# We upload the dataset to a GCS bucket using the Gcloud
if model == "gemini-3-pro-preview" and location != "global":