Skip to content

Commit

Permalink
Update pf pipeline tutorial (#3488)
Browse files Browse the repository at this point in the history
# Description
Update pf component tutorial to highlight the output ports are required
to be set as 'mount' when using multiple node.
Please add an informative description that covers that changes made by
the pull request and link all relevant issues.

# All Promptflow Contribution checklist:
- [ y ] **The pull request does not introduce [breaking changes].**
- [ ] **CHANGELOG is updated for new features, bug fixes or other
significant changes.**
- [ y ] **I have read the [contribution
guidelines](../CONTRIBUTING.md).**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#suggested-workflow).**

## General Guidelines and Best Practices
- [ ] Title of the pull request is clear and informative.
- [ ] There are a small number of commits, each of which have an
informative message. This means that previously merged commits do not
appear in the history of the PR. For more information on cleaning up the
commits in your PR, [see this
page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [ ] Pull request includes test coverage for the included changes.

---------

Co-authored-by: Philip Gao <yigao@microsoft.com>
  • Loading branch information
alainli0928 and crazygao authored Jul 3, 2024
1 parent 876eba1 commit ac574fa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This section contains a collection of flow samples and step-by-step tutorials.
|Flow|[Flow run management in azure](https://github.com/microsoft/promptflow/blob/main/examples/tutorials/run-management/cloud-run-management.ipynb)|Flow run management in Azure AI|
|Flow|[Flow run management](https://github.com/microsoft/promptflow/blob/main/examples/tutorials/run-management/run-management.ipynb)|Flow run management|
|Flow|[Evaluate with langchain's evaluator](https://github.com/microsoft/promptflow/blob/main/examples/flex-flows/eval-criteria-with-langchain/langchain-eval.ipynb)|A tutorial to converting LangChain criteria evaluator application to flex flow.|
|Flow|[Getting started with flex flow in azure](https://github.com/microsoft/promptflow/blob/main/examples/flex-flows/basic/flex-flow-quickstart-azure.ipynb)|A quickstart tutorial to run a flex flow and evaluate it in azure.|
|Flow|[Getting started with flex flow in azure](https://github.com/microsoft/promptflow/blob/main/examples/flex-flows/basic/flex-flow-quickstart-azure.ipynb)|A quickstart tutorial to run a flex flow and evaluate it in Azure.|
|Flow|[Chat with class based flex flow in azure](https://github.com/microsoft/promptflow/blob/main/examples/flex-flows/chat-basic/chat-with-class-based-flow-azure.ipynb)|A quickstart tutorial to run a class based flex flow and evaluate it in azure.|
|Flow|[Run dag flow in azure](https://github.com/microsoft/promptflow/blob/main/examples/tutorials/get-started/quickstart-azure.ipynb)|A quickstart tutorial to run a flow in Azure AI and evaluate it.|
|Deployment|[Create service with flow](https://github.com/microsoft/promptflow/blob/main/examples/tutorials/flow-deploy/create-service-with-flow/README.md)| This example shows how to create a simple service with flow|
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
| [trace-langchain.ipynb](tutorials/tracing/langchain/trace-langchain.ipynb) | [![samples_tracing_langchain_tracelangchain](https://github.com/microsoft/promptflow/actions/workflows/samples_tracing_langchain_tracelangchain.yml/badge.svg?branch=main)](https://github.com/microsoft/promptflow/actions/workflows/samples_tracing_langchain_tracelangchain.yml) | Tracing LLM calls in langchain application |
| [trace-llm.ipynb](tutorials/tracing/llm/trace-llm.ipynb) | [![samples_tracing_llm_tracellm](https://github.com/microsoft/promptflow/actions/workflows/samples_tracing_llm_tracellm.yml/badge.svg?branch=main)](https://github.com/microsoft/promptflow/actions/workflows/samples_tracing_llm_tracellm.yml) | Tracing LLM application |
| [connection.ipynb](connections/connection.ipynb) | [![samples_connections_connection](https://github.com/microsoft/promptflow/actions/workflows/samples_connections_connection.yml/badge.svg?branch=main)](https://github.com/microsoft/promptflow/actions/workflows/samples_connections_connection.yml) | Manage various types of connections using sdk |
| [flex-flow-quickstart-azure.ipynb](flex-flows/basic/flex-flow-quickstart-azure.ipynb) | [![samples_flexflows_basic_flexflowquickstartazure](https://github.com/microsoft/promptflow/actions/workflows/samples_flexflows_basic_flexflowquickstartazure.yml/badge.svg?branch=main)](https://github.com/microsoft/promptflow/actions/workflows/samples_flexflows_basic_flexflowquickstartazure.yml) | A quickstart tutorial to run a flex flow and evaluate it in azure. |
| [flex-flow-quickstart-azure.ipynb](flex-flows/basic/flex-flow-quickstart-azure.ipynb) | [![samples_flexflows_basic_flexflowquickstartazure](https://github.com/microsoft/promptflow/actions/workflows/samples_flexflows_basic_flexflowquickstartazure.yml/badge.svg?branch=main)](https://github.com/microsoft/promptflow/actions/workflows/samples_flexflows_basic_flexflowquickstartazure.yml) | A quickstart tutorial to run a flex flow and evaluate it in Azure. |
| [flex-flow-quickstart.ipynb](flex-flows/basic/flex-flow-quickstart.ipynb) | [![samples_flexflows_basic_flexflowquickstart](https://github.com/microsoft/promptflow/actions/workflows/samples_flexflows_basic_flexflowquickstart.yml/badge.svg?branch=main)](https://github.com/microsoft/promptflow/actions/workflows/samples_flexflows_basic_flexflowquickstart.yml) | A quickstart tutorial to run a flex flow and evaluate it. |
| [chat-stream-with-async-flex-flow.ipynb](flex-flows/chat-async-stream/chat-stream-with-async-flex-flow.ipynb) | [![samples_flexflows_chatasyncstream_chatstreamwithasyncflexflow](https://github.com/microsoft/promptflow/actions/workflows/samples_flexflows_chatasyncstream_chatstreamwithasyncflexflow.yml/badge.svg?branch=main)](https://github.com/microsoft/promptflow/actions/workflows/samples_flexflows_chatasyncstream_chatstreamwithasyncflexflow.yml) | A quickstart tutorial to run a class based flex flow in stream mode and evaluate it. |
| [chat-with-class-based-flow-azure.ipynb](flex-flows/chat-basic/chat-with-class-based-flow-azure.ipynb) | [![samples_flexflows_chatbasic_chatwithclassbasedflowazure](https://github.com/microsoft/promptflow/actions/workflows/samples_flexflows_chatbasic_chatwithclassbasedflowazure.yml/badge.svg?branch=main)](https://github.com/microsoft/promptflow/actions/workflows/samples_flexflows_chatbasic_chatwithclassbasedflowazure.yml) | A quickstart tutorial to run a class based flex flow and evaluate it in azure. |
Expand Down
12 changes: 10 additions & 2 deletions examples/tutorials/run-flow-with-pipeline/pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@
"| debug_info | uri_folder | If you run your flow component in __debug mode__, this port provides debugging information for each run of your lines. E.g. intermediate outputs between steps, or LLM response and token usage. |\n",
"\n",
"![prompt flow base component image](./media/cloud/flow-in-pipeline/pf-base-component.png)\n",
" \n",
"\n",
"> __NOTE:__</br>\n",
"> \n",
"> `flow_outputs` and `debug_info` outputs are required to be set `mount` mode as the output mode when you run pf component with multiple nodes. \n",
"\n",
" - Auto-generated parameters \n",
" \n",
" These parameters represent all your flow inputs and connections associated with your flow steps. You can set default values in the flow/run definition, and they can be further customized during job submission. Use '[web-classification](https://github.com/microsoft/promptflow/blob/main/examples/flows/standard/web-classification/flow.dag.yaml)' sample flow for example, this flow has only one input named 'url' and 2 LLM steps 'summarize_text_content' and 'classify_with_llm'. The input parameters of this flow component are:\n",
Expand Down Expand Up @@ -377,9 +381,13 @@
" flow_node.mini_batch_size = 5\n",
" flow_node.max_concurrency_per_instance = 2\n",
" flow_node.resources = {\"instance_count\": 1}\n",
" flow_node.outputs.flow_outputs.mode = \"rw_mount\"\n",
" flow_node.logging_level = \"DEBUG\"\n",
"\n",
" # set output mode to 'mount'\n",
" # This is required for the flow component when the 'instance_count' is set higher than 1\n",
" flow_node.outputs.flow_outputs.mode = \"mount\"\n",
" flow_node.outputs.debug_info.mode = \"mount\"\n",
"\n",
" result_parser_node = result_parser_component(\n",
" source_data=data_prep_node.outputs.output_data_folder,\n",
" pf_output_data=flow_node.outputs.flow_outputs,\n",
Expand Down

0 comments on commit ac574fa

Please sign in to comment.