You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current gemini/batch-prediction/intro_batch_prediction.ipynb notebook, the gcs_batch_job.dest.gcs_uri attribute from a completed job includes a trailing slash. When this URI is used with the notebook's f-string glob pattern, the resulting double slash breaks the path search, causing fsspec.glob() to fail to retrieve the predictions.jsonl file.
Could this issue be resolved by using .rstrip('/') on the URI before concatenation?
Relevant log output
fs = fsspec.filesystem("gcs")
# Since this pattern includes a double slash, file_paths will be an empty list.
file_paths = fs.glob(f"{gcs_batch_job.dest.gcs_uri}/*/predictions.jsonl")
if gcs_batch_job.state == "JOB_STATE_SUCCEEDED":
# Load the JSONL file into a DataFrame
df = pd.read_json(f"gs://{file_paths[0]}", lines=True)
df = df.join(pd.json_normalize(df["response"], "candidates"))
display(df)