Skip to content

Commit 0083d32

Browse files
committed
flyte nlp workflow
1 parent d7277b8 commit 0083d32

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

_quarto.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ format:
2020
footer: "ML Workflow Orchestration (Bernd Doser, HITS)"
2121
slide-number: true
2222
highlight-style: a11y
23-
code-block-height: 650px
23+
# code-block-height: 650px
2424
# width: 1300

code/streamflow_slurm.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
workflows:
2-
(same as left)
2+
# same as left
33

44
deployments:
55
ssh-cascade:
@@ -16,4 +16,4 @@ deployments:
1616
partition: cascade.p
1717
nodes: 1
1818
mem: 1gb
19-
wraps: ssh-cascade
19+
wraps: ssh-cascade

flyte.qmd

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,25 @@ def mean(values: List[float]) -> float:
4949

5050
## Flyte Workflows
5151

52-
todo ...
52+
- Workflows doesn’t perform computations it’s used to structure tasks
53+
54+
```python
55+
workflow_outputs = typing.NamedTuple(
56+
"WorkflowOutputs",
57+
simwords=Dict[str, float],
58+
distance=float,
59+
topics=Dict[int, List[str]],
60+
)
61+
62+
@workflow
63+
def nlp_workflow(target_word: str = "computer") -> workflow_outputs:
64+
corpus = generate_processed_corpus()
65+
model_wv = train_word2vec_model(training_data=corpus, hyperparams=Word2VecModelHyperparams())
66+
lda_topics = train_lda_model(corpus=corpus, hyperparams=LDAModelHyperparams())
67+
similar_words = word_similarities(model_ser=model_wv.model, word=target_word)
68+
distance = word_movers_distance(model_ser=model_wv.model)
69+
return similar_words, distance, lda_topics
70+
```
5371

5472

5573
## Containerized Tasks

0 commit comments

Comments
 (0)