v1.1.0
Browse files
run.py
CHANGED
@@ -9,7 +9,7 @@ from aiflows.utils.general_helpers import read_yaml_file
|
|
9 |
from aiflows import logging
|
10 |
from aiflows.flow_cache import CACHING_PARAMETERS, clear_cache
|
11 |
|
12 |
-
from aiflows.utils import
|
13 |
from aiflows.workers import run_dispatch_worker_thread
|
14 |
from aiflows.messages import FlowMessage
|
15 |
from aiflows.interfaces import KeyInterface
|
@@ -40,7 +40,7 @@ if __name__ == "__main__":
|
|
40 |
cfg = read_yaml_file(cfg_path)
|
41 |
|
42 |
#3. ~~~~ Serve The Flow ~~~~
|
43 |
-
|
44 |
cl = cl,
|
45 |
flow_class_name="flow_modules.aiflows.HumanStandardInputFlowModule.HumanStandardInputFlow",
|
46 |
flow_endpoint="HumanStandardInputFlow",
|
@@ -51,7 +51,7 @@ if __name__ == "__main__":
|
|
51 |
run_dispatch_worker_thread(cl)
|
52 |
|
53 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
54 |
-
proxy_flow=
|
55 |
cl=cl,
|
56 |
flow_endpoint="HumanStandardInputFlow",
|
57 |
user_id="local",
|
@@ -91,4 +91,4 @@ if __name__ == "__main__":
|
|
91 |
|
92 |
|
93 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
94 |
-
#
|
|
|
9 |
from aiflows import logging
|
10 |
from aiflows.flow_cache import CACHING_PARAMETERS, clear_cache
|
11 |
|
12 |
+
from aiflows.utils import serving
|
13 |
from aiflows.workers import run_dispatch_worker_thread
|
14 |
from aiflows.messages import FlowMessage
|
15 |
from aiflows.interfaces import KeyInterface
|
|
|
40 |
cfg = read_yaml_file(cfg_path)
|
41 |
|
42 |
#3. ~~~~ Serve The Flow ~~~~
|
43 |
+
serving.serve_flow(
|
44 |
cl = cl,
|
45 |
flow_class_name="flow_modules.aiflows.HumanStandardInputFlowModule.HumanStandardInputFlow",
|
46 |
flow_endpoint="HumanStandardInputFlow",
|
|
|
51 |
run_dispatch_worker_thread(cl)
|
52 |
|
53 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
54 |
+
proxy_flow= serving.get_flow_instance(
|
55 |
cl=cl,
|
56 |
flow_endpoint="HumanStandardInputFlow",
|
57 |
user_id="local",
|
|
|
91 |
|
92 |
|
93 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
94 |
+
# serving.delete_served_flow(cl, "ReverseNumberAtomicFlow_served")
|