Skip to content

Commit

Permalink
Update for Fondant 0.7.0 (#5)
Browse files Browse the repository at this point in the history
I already published Fondant 0.7.0 to test.pypi so we can upgrade our
examples and test them against it (which I did). The main change is the
split of the component and pipeline SDKs.
  • Loading branch information
RobbeSneyders authored Nov 20, 2023
1 parent 09dae57 commit 975678e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
fondant==0.6.2
fondant==0.7.0
notebook==7.0.6
26 changes: 13 additions & 13 deletions src/pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"source": [
"from pathlib import Path\n",
"\n",
"from fondant.pipeline import ComponentOp, Pipeline\n",
"from fondant.pipeline import ComponentOp, Pipeline, Resources\n",
"\n",
"BASE_PATH = \"./data_dir\"\n",
"Path(BASE_PATH).mkdir(parents=True, exist_ok=True)\n",
Expand Down Expand Up @@ -257,8 +257,10 @@
" \"batch_size\": 8,\n",
" \"max_new_tokens\": 50,\n",
" },\n",
" number_of_accelerators=number_of_accelerators,\n",
" accelerator_name=accelerator_name,\n",
" resources=Resources(\n",
" accelerator_number=number_of_accelerators,\n",
" accelerator_name=accelerator_name,\n",
" ),\n",
")\n",
"\n",
"segment_images_op = ComponentOp.from_registry(\n",
Expand All @@ -267,8 +269,10 @@
" \"model_id\": \"openmmlab/upernet-convnext-small\",\n",
" \"batch_size\": 8,\n",
" },\n",
" number_of_accelerators=number_of_accelerators,\n",
" accelerator_name=accelerator_name,\n",
" resources=Resources(\n",
" accelerator_number=number_of_accelerators,\n",
" accelerator_name=accelerator_name,\n",
" ),\n",
")"
]
},
Expand All @@ -293,9 +297,7 @@
},
{
"cell_type": "markdown",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"## Optional: writing the dataset to the Hugging Face Hub "
]
Expand Down Expand Up @@ -450,10 +452,8 @@
"metadata": {},
"outputs": [],
"source": [
"from fondant.compiler import DockerCompiler\n",
"from fondant.runner import DockerRunner\n",
"\n",
"from pathlib import Path\n",
"from fondant.pipeline.compiler import DockerCompiler\n",
"from fondant.pipeline.runner import DockerRunner\n",
"\n",
"DockerCompiler().compile(pipeline=pipeline, output_path=\"docker-compose.yml\")\n",
"DockerRunner().run(\"docker-compose.yml\")"
Expand All @@ -479,7 +479,7 @@
"metadata": {},
"outputs": [],
"source": [
"from fondant.explorer import run_explorer_app\n",
"from fondant.explore import run_explorer_app\n",
"\n",
"run_explorer_app(\n",
" base_path=BASE_PATH,\n",
Expand Down

0 comments on commit 975678e

Please sign in to comment.