Skip to content

Commit

Permalink
Update for Fondant 0.7.0 (#22)
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 36dad86 commit 8f9f875
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 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
2 changes: 1 addition & 1 deletion src/components/text_cleaning/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fondant[component]==0.6.2
fondant[component]==0.7.0
27 changes: 14 additions & 13 deletions src/pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install -r requirements.txt"
"!pip install -r ../requirements.txt"
]
},
{
Expand All @@ -100,7 +100,6 @@
"metadata": {},
"outputs": [],
"source": [
"import fsspec\n",
"from fondant.pipeline import ComponentOp, Pipeline\n",
"from pathlib import Path\n",
"\n",
Expand Down Expand Up @@ -187,7 +186,7 @@
" \"column_name_mapping\": {\n",
" \"text\": \"text_data\"\n",
" },\n",
" \"n_rows_to_load\": 10\n",
" \"n_rows_to_load\": 100\n",
" }\n",
")\n",
"\n",
Expand Down Expand Up @@ -302,8 +301,8 @@
"metadata": {},
"outputs": [],
"source": [
"from fondant.compiler import DockerCompiler\n",
"from fondant.runner import DockerRunner\n",
"from fondant.pipeline.compiler import DockerCompiler\n",
"from fondant.pipeline.runner import DockerRunner\n",
"\n",
"DockerCompiler().compile(pipeline, output_path=\"docker-compose.yaml\")\n",
"DockerRunner().run(\"docker-compose.yaml\")"
Expand All @@ -324,7 +323,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 Expand Up @@ -373,7 +372,7 @@
"%%writefile components/text_cleaning/fondant_component.yaml\n",
"name: Text cleaning component\n",
"description: Clean text passages\n",
"image: text-cleaning-component:latest\n",
"image: ghcr.io/ml6team/text_cleaning:dev\n",
"\n",
"consumes:\n",
" text:\n",
Expand Down Expand Up @@ -412,7 +411,7 @@
"logger = logging.getLogger(__name__)\n",
"\n",
"\n",
"class TextCleaningComponent(PandasTransformComponent): \n",
"class TextCleaningComponent(PandasTransformComponent):\n",
" def __init__(self, *_):\n",
" \"\"\"Initialize your component\"\"\"\n",
"\n",
Expand All @@ -422,7 +421,9 @@
" return \"\\n\".join(non_empty_lines)\n",
"\n",
" def transform(self, dataframe: pd.DataFrame) -> pd.DataFrame:\n",
" dataframe[(\"text\", \"data\")] = dataframe[(\"text\", \"data\")].apply(lambda x: self.remove_empty_lines)\n",
" dataframe[(\"text\", \"data\")] = dataframe[(\"text\", \"data\")].apply(\n",
" lambda x: self.remove_empty_lines\n",
" )\n",
" return dataframe"
]
},
Expand Down Expand Up @@ -477,7 +478,7 @@
"outputs": [],
"source": [
"%%writefile components/text_cleaning/requirements.txt\n",
"fondant[component]==0.6.2"
"fondant[component]==0.7.0"
]
},
{
Expand Down Expand Up @@ -582,7 +583,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -596,9 +597,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
1 change: 0 additions & 1 deletion src/requirements.txt

This file was deleted.

0 comments on commit 8f9f875

Please sign in to comment.