Skip to content

Commit a86ac3f

Browse files
committed
feat: add temp workdir for gcs workout
1 parent 1390ee8 commit a86ac3f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

demo-notebooks/additional-demos/batch-inference/remote_offline_bi.ipynb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,18 @@
133133
"metadata": {},
134134
"outputs": [],
135135
"source": [
136+
"import tempfile\n",
137+
"import shutil\n",
138+
"\n",
139+
"# Create a clean directory with ONLY your script\n",
140+
"temp_dir = tempfile.mkdtemp()\n",
141+
"shutil.copy(\"simple_batch_inf.py\", temp_dir)\n",
142+
"\n",
136143
"entrypoint_command = \"python simple_batch_inf.py\"\n",
137144
"\n",
138145
"submission_id = client.submit_job(\n",
139146
" entrypoint=entrypoint_command,\n",
140-
" runtime_env={\"working_dir\": \"./\", \"pip\": \"requirements.txt\"},\n",
147+
" runtime_env={\"working_dir\": temp_dir, \"pip\": \"requirements.txt\"},\n",
141148
")\n",
142149
"\n",
143150
"print(submission_id + \" successfully submitted\")"

0 commit comments

Comments
 (0)