gentle-scientist-22504
09/19/2024, 3:50 PMRequest rejected by the API, due to Invalid input. Details: train.setup task with different structure already exists. I need to be able to run the same workflow with different input parametersjolly-florist-66728
09/19/2024, 3:50 PMpyflyte register or flytectl register commands. Here's an example of how to do it:
1. Package the workflow:
pyflyte package
2. Register the workflow with a new version:
flytectl register files --project project --domain domain --version new_version --archive flyte-package.tgz
Alternatively, you can use pyflyte register directly:
pyflyte register --project project --domain domain --version new_version
Would you like more details on this process or any other aspect of Flyte?
Sources:
- https://github.com/flyteorg/flyte/issues/5426
- https://github.com/flyteorg/flyte/issues/5415 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.gentle-scientist-22504
09/19/2024, 3:51 PMjolly-florist-66728
09/19/2024, 3:51 PMfrom flytekit import task, dynamic, workflow
@task
def process_data(input: str) -> str:
return f"Processed {input}"
@dynamic
def dynamic_wf(inputs: list[str]):
results = []
for input in inputs:
results.append(process_data(input=input))
return results
@workflow
def wf(inputs: list[str]):
return dynamic_wf(inputs=inputs)
2. Launch Plans: Create a launch plan with default inputs and override them at execution time.
from flytekit import LaunchPlan, workflow
@workflow
def wf(input: str):
process_data(input=input)
launch_plan = LaunchPlan.create(
"wf_launch_plan",
wf,
default_inputs={"input": "default_value"}
)
You can then override the input when executing the launch plan:
flytectl create execution --project project --domain domain --name name --launchplan wf_launch_plan --inputs '{"input": "new_value"}'
Would you like more details on dynamic workflows or launch plans?
Sources:
- Flyte Dynamic Workflows
- Flyte Launch Plans 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.gentle-scientist-22504
09/19/2024, 3:52 PM