Commit
•
e4fce0b
1
Parent(s):
916a98f
Update run.py (#1)
Browse files- Update run.py (f9c6994c1e2b458f40eee28be6dd5dbd8ca943ea)
Co-authored-by: Neel Shah <Neel-Shah-29@users.noreply.huggingface.co>
run.py
CHANGED
@@ -9,7 +9,7 @@ from aiflows.utils.general_helpers import read_yaml_file, quick_load_api_keys
|
|
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
|
@@ -54,7 +54,7 @@ if __name__ == "__main__":
|
|
54 |
|
55 |
|
56 |
#3. ~~~~ Serve The Flow ~~~~
|
57 |
-
|
58 |
cl=cl,
|
59 |
flow_class_name="flow_modules.aiflows.ChatFlowModule.ChatAtomicFlow",
|
60 |
flow_endpoint="ChatAtomicFlow",
|
@@ -64,7 +64,7 @@ if __name__ == "__main__":
|
|
64 |
run_dispatch_worker_thread(cl)
|
65 |
|
66 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
67 |
-
proxy_flow=
|
68 |
cl=cl,
|
69 |
flow_endpoint="ChatAtomicFlow",
|
70 |
user_id="local",
|
@@ -100,6 +100,6 @@ if __name__ == "__main__":
|
|
100 |
|
101 |
|
102 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
103 |
-
#
|
104 |
|
105 |
|
|
|
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
|
|
|
54 |
|
55 |
|
56 |
#3. ~~~~ Serve The Flow ~~~~
|
57 |
+
serving.serve_flow(
|
58 |
cl=cl,
|
59 |
flow_class_name="flow_modules.aiflows.ChatFlowModule.ChatAtomicFlow",
|
60 |
flow_endpoint="ChatAtomicFlow",
|
|
|
64 |
run_dispatch_worker_thread(cl)
|
65 |
|
66 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
67 |
+
proxy_flow= serving.get_flow_instance(
|
68 |
cl=cl,
|
69 |
flow_endpoint="ChatAtomicFlow",
|
70 |
user_id="local",
|
|
|
100 |
|
101 |
|
102 |
#9. ~~~~~Optional: Unserve Flow~~~~~~
|
103 |
+
# serving.delete_served_flow(cl, "ReverseNumberAtomicFlow_served")
|
104 |
|
105 |
|