truss 0.11.1rc14__py3-none-any.whl → 0.11.2rc500__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of truss might be problematic. Click here for more details.
- truss/base/constants.py +0 -1
- truss/cli/train/core.py +0 -156
- truss/cli/train/deploy_checkpoints/deploy_checkpoints.py +1 -13
- truss/cli/train_commands.py +0 -72
- truss/templates/base.Dockerfile.jinja +3 -1
- truss/templates/control/control/endpoints.py +33 -82
- truss/templates/control/requirements.txt +1 -1
- truss/templates/server/common/errors.py +0 -1
- truss/templates/server/entrypoint.sh +16 -0
- truss/templates/server/truss_server.py +3 -5
- truss/templates/server.Dockerfile.jinja +4 -2
- truss/tests/cli/train/test_deploy_checkpoints.py +3 -3
- truss/tests/templates/control/control/test_endpoints.py +14 -20
- {truss-0.11.1rc14.dist-info → truss-0.11.2rc500.dist-info}/METADATA +1 -1
- {truss-0.11.1rc14.dist-info → truss-0.11.2rc500.dist-info}/RECORD +20 -22
- truss_chains/public_types.py +0 -1
- truss_chains/remote_chainlet/utils.py +0 -18
- truss/templates/train/config.py +0 -46
- truss/templates/train/run.sh +0 -11
- truss/tests/cli/train/test_train_init.py +0 -499
- {truss-0.11.1rc14.dist-info → truss-0.11.2rc500.dist-info}/WHEEL +0 -0
- {truss-0.11.1rc14.dist-info → truss-0.11.2rc500.dist-info}/entry_points.txt +0 -0
- {truss-0.11.1rc14.dist-info → truss-0.11.2rc500.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,7 +2,7 @@ truss/__init__.py,sha256=CoUcP6vx_pocyemRmpbCPlndkHhdMkABAlr0ZXVuPCk,1163
|
|
|
2
2
|
truss/api/__init__.py,sha256=spBAa_m1pItiid97iDLKPmumgAkSirPkv-E8RWMZyOk,5090
|
|
3
3
|
truss/api/definitions.py,sha256=QAaIBqL59Q-R7HtLcXcoeCIWBN2HqOzApdFX0PpCq2s,1604
|
|
4
4
|
truss/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
truss/base/constants.py,sha256=
|
|
5
|
+
truss/base/constants.py,sha256=qwNNkd9EOAuiTxYLVccJaiPCNRayBAFvyj_GisYOT3I,3488
|
|
6
6
|
truss/base/custom_types.py,sha256=FUSIT2lPOQb6gfg6IzT63YBV8r8L6NIZ0D74Fp3e_jQ,2835
|
|
7
7
|
truss/base/errors.py,sha256=zDVLEvseTChdPP0oNhBBQCtQUtZJUaof5zeWMIjqz6o,691
|
|
8
8
|
truss/base/trt_llm_config.py,sha256=CRz3AqGDAyv8YpcBWXUrnfjvNAauyo3yf8ZOGVsSt6g,32782
|
|
@@ -11,20 +11,20 @@ truss/base/truss_spec.py,sha256=jFVF79CXoEEspl2kXBAPyi-rwISReIGTdobGpaIhwJw,5979
|
|
|
11
11
|
truss/cli/chains_commands.py,sha256=bqOXQ-0RPS66vSP_OPQdJ5dvctGiVrsGoSUMbURGdSI,16970
|
|
12
12
|
truss/cli/cli.py,sha256=PaMkuwXZflkU7sa1tEoT_Zmy-iBkEZs1m4IVqcieaeo,30367
|
|
13
13
|
truss/cli/remote_cli.py,sha256=G_xCKRXzgkCmkiZJhUFfsv5YSVgde1jLA5LPQitpZgI,1905
|
|
14
|
-
truss/cli/train_commands.py,sha256=
|
|
14
|
+
truss/cli/train_commands.py,sha256=GDye7yXGL_nQvXAlY5MWsdj5x0zYOvcQw0Ubn14TiRU,14365
|
|
15
15
|
truss/cli/logs/base_watcher.py,sha256=KKyd7lIrdaEeDVt8EtjMioSPGVpLyOcF0ewyzE_GGdQ,2785
|
|
16
16
|
truss/cli/logs/model_log_watcher.py,sha256=NACcP-wkcaroYa2Cb9BZC7Yr0554WZa_FSM2LXOf4A8,1263
|
|
17
17
|
truss/cli/logs/training_log_watcher.py,sha256=r6HRqrLnz-PiKTUXiDYYxg4ZnP8vYcXlEX1YmgHhzlo,1173
|
|
18
18
|
truss/cli/logs/utils.py,sha256=z-U_FG4BUzdZLbE3BnXb4DZQ0zt3LSZ3PiQpLaDuc3o,1031
|
|
19
19
|
truss/cli/train/common.py,sha256=xTR41U5FeSndXfNBBHF9wF5XwZH1sOIVFlv-XHjsKIU,1547
|
|
20
|
-
truss/cli/train/core.py,sha256=
|
|
20
|
+
truss/cli/train/core.py,sha256=dAmetxKqSc4bQPnVS_8WLfNsw1L7vLT2tU02BVwRPgc,20206
|
|
21
21
|
truss/cli/train/deploy_from_checkpoint_config.yml,sha256=mktaVrfhN8Kjx1UveC4xr-gTW-kjwbHvq6bx_LpO-Wg,371
|
|
22
22
|
truss/cli/train/deploy_from_checkpoint_config_whisper.yml,sha256=6GbOorYC8ml0UyOUvuBpFO_fuYtYE646JqsalR-D4oY,406
|
|
23
23
|
truss/cli/train/metrics_watcher.py,sha256=smz-zrEsBj_-wJHI0pAZ-EAPrvfCWzq1eQjGiFNM-Mk,12755
|
|
24
24
|
truss/cli/train/poller.py,sha256=TGRzELxsicga0bEXewSX1ujw6lfPmDnHd6nr8zvOFO8,3550
|
|
25
25
|
truss/cli/train/types.py,sha256=alGtr4Q71GeB65PpGMhsoKygw4k_ncR6MKIP1ioP8rI,951
|
|
26
26
|
truss/cli/train/deploy_checkpoints/__init__.py,sha256=wL-M2yu8PxO2tFvjwshXAfPnB-5TlvsBp2v_bdzimRU,99
|
|
27
|
-
truss/cli/train/deploy_checkpoints/deploy_checkpoints.py,sha256=
|
|
27
|
+
truss/cli/train/deploy_checkpoints/deploy_checkpoints.py,sha256=xfblHi3py7GDgY24NcuAaDKzcQeOm67rjtWOK6vAEe4,17352
|
|
28
28
|
truss/cli/train/deploy_checkpoints/deploy_checkpoints_helpers.py,sha256=6x5nS_HnWYtS9vi-Pg8akzrJk9L_agjvFhm5EFh1m6Y,1964
|
|
29
29
|
truss/cli/train/deploy_checkpoints/deploy_full_checkpoints.py,sha256=FYRG5KTMlxEMZS-RA_m2gp1wuqWbSpqt2RhdQfLibhA,3968
|
|
30
30
|
truss/cli/train/deploy_checkpoints/deploy_lora_checkpoints.py,sha256=P91dIAzuhl2GlzmrWwCcYI7uCMT1Lm7C79JQHM_exN4,4442
|
|
@@ -66,15 +66,15 @@ truss/remote/baseten/utils/time.py,sha256=Ry9GMjYnbIGYVIGwtmv4V8ljWjvdcaCf5NOQzl
|
|
|
66
66
|
truss/remote/baseten/utils/transfer.py,sha256=d3VptuQb6M1nyS6kz0BAfeOYDLkMKUjatJXpY-mp-As,1548
|
|
67
67
|
truss/templates/README.md.jinja,sha256=N7CJdyldZuJamj5jLh47le0hFBdu9irVsTBqoxhPNPQ,2476
|
|
68
68
|
truss/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
69
|
-
truss/templates/base.Dockerfile.jinja,sha256=
|
|
69
|
+
truss/templates/base.Dockerfile.jinja,sha256=BaI8BY-h_WCREYXtC_Zy56Mw8oGjORA9Kgjm-S8EF88,5788
|
|
70
70
|
truss/templates/cache.Dockerfile.jinja,sha256=1qZqDo1phrcqi-Vwol-VafYJkADsBbQWU6huQ-_1x00,1146
|
|
71
71
|
truss/templates/cache_requirements.txt,sha256=xoPoJ-OVnf1z6oq_RVM3vCr3ionByyqMLj7wGs61nUs,87
|
|
72
72
|
truss/templates/copy_cache_files.Dockerfile.jinja,sha256=Os5zFdYLZ_AfCRGq4RcpVTObOTwL7zvmwYcvOzd_Zqo,126
|
|
73
73
|
truss/templates/docker_server_requirements.txt,sha256=PyhOPKAmKW1N2vLvTfLMwsEtuGpoRrbWuNo7tT6v2Mc,18
|
|
74
|
-
truss/templates/server.Dockerfile.jinja,sha256=
|
|
75
|
-
truss/templates/control/requirements.txt,sha256=
|
|
74
|
+
truss/templates/server.Dockerfile.jinja,sha256=fNrCi1sGefjGlu2JOzLu8E7PiwZvpoq8JgW_BBhvya0,7219
|
|
75
|
+
truss/templates/control/requirements.txt,sha256=Kk0tYID7trPk5gwX38Wrt2-YGWZAXFJCJRcqJ8ZzCjc,251
|
|
76
76
|
truss/templates/control/control/application.py,sha256=jYeta6hWe1SkfLL3W4IDmdYjg3ZuKqI_UagWYs5RB_E,3793
|
|
77
|
-
truss/templates/control/control/endpoints.py,sha256=
|
|
77
|
+
truss/templates/control/control/endpoints.py,sha256=FM-sgao7I3gMoUTasM3Xq_g2LDoJQe75JxIoaQxzeNo,10031
|
|
78
78
|
truss/templates/control/control/server.py,sha256=R4Y219i1dcz0kkksN8obLoX-YXWGo9iW1igindyG50c,3128
|
|
79
79
|
truss/templates/control/control/helpers/context_managers.py,sha256=W6dyFgLBhPa5meqrOb3w_phMtKfaJI-GhwUfpiycDc8,413
|
|
80
80
|
truss/templates/control/control/helpers/custom_types.py,sha256=n_lTudtLTpy4oPV3aDdJ4X2rh3KCV5btYO9UnTeUouQ,5471
|
|
@@ -94,12 +94,13 @@ truss/templates/custom_python_dx/my_model.py,sha256=NG75mQ6wxzB1BYUemDFZvRLBET-U
|
|
|
94
94
|
truss/templates/docker_server/proxy.conf.jinja,sha256=Lg-PcZzKflG85exZKHNgW_I6r0mATV8AtOIBaE40-RM,1669
|
|
95
95
|
truss/templates/docker_server/supervisord.conf.jinja,sha256=dd37fwZE--cutrvOUCqEyJQQQhlp61H2IUs2huKWsSk,1808
|
|
96
96
|
truss/templates/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
97
|
+
truss/templates/server/entrypoint.sh,sha256=IzRP19uFyNZokfgrIahERmniKtYtzljZlSKbejiZ2LY,348
|
|
97
98
|
truss/templates/server/main.py,sha256=kWXrdD8z8IpamyWxc8qcvd5ck9gM1Kz2QH5qHJCnmOQ,222
|
|
98
99
|
truss/templates/server/model_wrapper.py,sha256=k75VVISwwlsx5EGb82UZsu8kCM_i6Yi3-Hd0-Kpm1yo,42055
|
|
99
100
|
truss/templates/server/requirements.txt,sha256=XblmpfxAmRo3X1V_9oMj8yjdpZ5Wk-C2oa3z6nq4OGw,672
|
|
100
|
-
truss/templates/server/truss_server.py,sha256=
|
|
101
|
+
truss/templates/server/truss_server.py,sha256=ob_nceeGtFPZzKKdk_ZZGLoZrJOGE6hR52xM1sPR97A,19498
|
|
101
102
|
truss/templates/server/common/__init__.py,sha256=qHIqr68L5Tn4mV6S-PbORpcuJ4jmtBR8aCuRTIWDvNo,85
|
|
102
|
-
truss/templates/server/common/errors.py,sha256=
|
|
103
|
+
truss/templates/server/common/errors.py,sha256=qWeZlmNI8ZGbZbOIp_mtS6IKvUFIzhj3QH8zp-xTp9o,8554
|
|
103
104
|
truss/templates/server/common/patches.py,sha256=uEOzvDnXsHOkTSa8zygGYuR4GHhrFNVHNQc5peJcwvo,1393
|
|
104
105
|
truss/templates/server/common/retry.py,sha256=dtz6yvwLoY0i55FnxECz57zEOKjAhGMYvvM-k9jiR9c,624
|
|
105
106
|
truss/templates/server/common/schema.py,sha256=WLFtVyEKmk4whg5_gk6Gt1vOD6wM5fWKLb4zNuD0bkw,6042
|
|
@@ -112,8 +113,6 @@ truss/templates/shared/log_config.py,sha256=l9udyu4VKHZePlfK9LQEd5TOUUodPuehypsX
|
|
|
112
113
|
truss/templates/shared/secrets_resolver.py,sha256=3prDe3Q06NTmUEe7KCW-W4TD1CzGck9lpDG789209z4,2110
|
|
113
114
|
truss/templates/shared/serialization.py,sha256=_WC_2PPkRi-MdTwxwjG8LKQptnHi4sANfpOlKWevqWc,3736
|
|
114
115
|
truss/templates/shared/util.py,sha256=dPgFF4iL_YkeC6Kf8tZUHJH60rbpskHwVPh0ONLGaQM,2222
|
|
115
|
-
truss/templates/train/config.py,sha256=aQJ3lsyVRlq6edjjZq4_Anz1bZVwkjLdclmZPJTdo1k,1626
|
|
116
|
-
truss/templates/train/run.sh,sha256=2rimigJOn6yg4DguRfOJWkzm77X-meNSYXnidLafqNg,346
|
|
117
116
|
truss/templates/trtllm-audio/model/model.py,sha256=o38QqW57b1lf8O_td1lW_AojZZ8R_qAZCgzOWtoIse8,1619
|
|
118
117
|
truss/templates/trtllm-audio/packages/sigint_patch.py,sha256=t6pYpVwgQsLCgcxQq7-V3scr9ZOiIxtYSpy9LCfdNTk,414
|
|
119
118
|
truss/templates/trtllm-audio/packages/whisper_trt/__init__.py,sha256=5ZQfVlwtkWrnjYiuBIVSviYDhV-kksygDkHEWBS_ijM,7065
|
|
@@ -142,9 +141,8 @@ truss/tests/test_truss_handle.py,sha256=-xz9VXkecXDTslmQZ-dmUmQLnvD0uumRqHS2uvGl
|
|
|
142
141
|
truss/tests/test_util.py,sha256=hs1bNMkXKEdoPRx4Nw-NAEdoibR92OubZuADGmbiYsQ,1344
|
|
143
142
|
truss/tests/cli/test_cli.py,sha256=yfbVS5u1hnAmmA8mJ539vj3lhH-JVGUvC4Q_Mbort44,787
|
|
144
143
|
truss/tests/cli/train/test_cache_view.py,sha256=aVRCh3atRpFbJqyYgq7N-vAW0DiKMftQ7ajUqO2ClOg,22606
|
|
145
|
-
truss/tests/cli/train/test_deploy_checkpoints.py,sha256=
|
|
144
|
+
truss/tests/cli/train/test_deploy_checkpoints.py,sha256=wQZ3DPLPAyXE3iaQiyHJTBO15v_gXN44eDk1StYkKmM,44764
|
|
146
145
|
truss/tests/cli/train/test_train_cli_core.py,sha256=vzYfxKdwoa3NaFMrVZbSg5qOoLXivMvZXN1ClQirGTQ,16148
|
|
147
|
-
truss/tests/cli/train/test_train_init.py,sha256=pv8BfyLlVG0QtdowTziITjKa_OE1KigatmAGx8XSZrM,17238
|
|
148
146
|
truss/tests/cli/train/resources/test_deploy_from_checkpoint_config.yml,sha256=GF7r9l0KaeXiUYCPSBpeMPd2QG6PeWWyI12NdbqLOgc,1930
|
|
149
147
|
truss/tests/contexts/image_builder/test_serving_image_builder.py,sha256=16niCXZnuxFHXYQw2vPFZ8svSZafkH5DT0Gx3Z9Xdd8,22377
|
|
150
148
|
truss/tests/contexts/local_loader/test_load_local.py,sha256=D1qMH2IpYA2j5009v50QMgUnKdeOsX15ndkwXe10a4E,801
|
|
@@ -164,7 +162,7 @@ truss/tests/remote/baseten/test_auth.py,sha256=ttu4bDnmwGfo3oiNut4HVGnh-QnjAefwZ
|
|
|
164
162
|
truss/tests/remote/baseten/test_core.py,sha256=6NzJTDmoSUv6Muy1LFEYIUg10-cqw-hbLyeTSWcdNjY,26117
|
|
165
163
|
truss/tests/remote/baseten/test_remote.py,sha256=y1qSPL1t7dBeYI3xMFn436fttG7wkYdAoENTz7qKObg,23634
|
|
166
164
|
truss/tests/remote/baseten/test_service.py,sha256=ufZbtQlBNIzFCxRt_iE-APLpWbVw_3ViUpSh6H9W5nU,1945
|
|
167
|
-
truss/tests/templates/control/control/test_endpoints.py,sha256=
|
|
165
|
+
truss/tests/templates/control/control/test_endpoints.py,sha256=tGU3w8zOKC8LfWGdhp-TlV7E603KXg2xGwpqDdf8Pnw,3385
|
|
168
166
|
truss/tests/templates/control/control/test_server.py,sha256=r1O3VEK9eoIL2-cg8nYLXYct_H3jf5rGp1wLT1KBdeA,9488
|
|
169
167
|
truss/tests/templates/control/control/test_server_integration.py,sha256=EdDY3nLzjrRCJ5LI5yZsNCEImSRkxTL7Rn9mGnK67zA,11837
|
|
170
168
|
truss/tests/templates/control/control/helpers/test_context_managers.py,sha256=3LoonRaKu_UvhaWs1eNmEQCZq-iJ3aIjI0Mn4amC8Bw,283
|
|
@@ -348,7 +346,7 @@ truss_chains/__init__.py,sha256=QDw1YwdqMaQpz5Oltu2Eq2vzEX9fDrMoqnhtbeh60i4,1278
|
|
|
348
346
|
truss_chains/framework.py,sha256=CS7tSegPe2Q8UUT6CDkrtSrB3utr_1QN1jTEPjrj5Ug,67519
|
|
349
347
|
truss_chains/private_types.py,sha256=6CaQEPawFLXjEbJ-01lqfexJtUIekF_q61LNENWegFo,8917
|
|
350
348
|
truss_chains/public_api.py,sha256=0AXV6UdZIFAMycUNG_klgo4aLFmBZeKGfrulZEWzR0M,9532
|
|
351
|
-
truss_chains/public_types.py,sha256=
|
|
349
|
+
truss_chains/public_types.py,sha256=q8Oet6MpECW1FhWW25SCExpZhmk4cFmEsqrO30oZIMw,29112
|
|
352
350
|
truss_chains/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
353
351
|
truss_chains/pydantic_numpy.py,sha256=MG8Ji_Inwo_JSfM2n7TPj8B-nbrBlDYsY3SOeBwD8fE,4289
|
|
354
352
|
truss_chains/streaming.py,sha256=DGl2LEAN67YwP7Nn9MK488KmYc4KopWmcHuE6WjyO1Q,12521
|
|
@@ -361,14 +359,14 @@ truss_chains/reference_code/reference_model.py,sha256=emH3hb23E_nbP98I37PGp1Xk1h
|
|
|
361
359
|
truss_chains/remote_chainlet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
362
360
|
truss_chains/remote_chainlet/model_skeleton.py,sha256=8ZReLOO2MLcdg7bNZ61C-6j-e68i2Z-fFlyV3sz0qH8,2376
|
|
363
361
|
truss_chains/remote_chainlet/stub.py,sha256=Y2gDUzMY9WRaQNHIz-o4dfLUfFyYV9dUhIRQcfgrY8g,17209
|
|
364
|
-
truss_chains/remote_chainlet/utils.py,sha256=
|
|
362
|
+
truss_chains/remote_chainlet/utils.py,sha256=O_5P-VAUvg0cegEW1uKCOf5EBwD8rEGYVoGMivOmc7k,22374
|
|
365
363
|
truss_train/__init__.py,sha256=7hE6j6-u6UGzCGaNp3CsCN0kAVjBus1Ekups-Bk0fi4,837
|
|
366
364
|
truss_train/definitions.py,sha256=V985HhY4rdXL10DZxpFEpze9ScxzWErMht4WwaPknGU,6789
|
|
367
365
|
truss_train/deployment.py,sha256=lWWANSuzBWu2M4oK4qD7n-oVR1JKdmw2Pn5BJQHg-Ck,3074
|
|
368
366
|
truss_train/loader.py,sha256=0o66EjBaHc2YY4syxxHVR4ordJWs13lNXnKjKq2wq0U,1630
|
|
369
367
|
truss_train/public_api.py,sha256=9N_NstiUlmBuLUwH_fNG_1x7OhGCytZLNvqKXBlStrM,1220
|
|
370
|
-
truss-0.11.
|
|
371
|
-
truss-0.11.
|
|
372
|
-
truss-0.11.
|
|
373
|
-
truss-0.11.
|
|
374
|
-
truss-0.11.
|
|
368
|
+
truss-0.11.2rc500.dist-info/METADATA,sha256=q5ZsMYInoM3A01Pr6sFqxvtG2y_-Zvn1J2YI1dyik3s,6674
|
|
369
|
+
truss-0.11.2rc500.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
370
|
+
truss-0.11.2rc500.dist-info/entry_points.txt,sha256=-MwKfHHQHQ6j0HqIgvxrz3CehCmczDLTD-OsRHnjjuU,130
|
|
371
|
+
truss-0.11.2rc500.dist-info/licenses/LICENSE,sha256=FTqGzu85i-uw1Gi8E_o0oD60bH9yQ_XIGtZbA1QUYiw,1064
|
|
372
|
+
truss-0.11.2rc500.dist-info/RECORD,,
|
truss_chains/public_types.py
CHANGED
|
@@ -473,7 +473,6 @@ class WebSocketProtocol(Protocol):
|
|
|
473
473
|
|
|
474
474
|
async def close(self, code: int = 1000, reason: Optional[str] = None) -> None: ...
|
|
475
475
|
|
|
476
|
-
async def receive(self) -> Union[str, bytes]: ...
|
|
477
476
|
async def receive_text(self) -> str: ...
|
|
478
477
|
async def receive_bytes(self) -> bytes: ...
|
|
479
478
|
async def receive_json(self) -> Any: ...
|
|
@@ -11,7 +11,6 @@ import textwrap
|
|
|
11
11
|
import threading
|
|
12
12
|
import time
|
|
13
13
|
import traceback
|
|
14
|
-
import typing
|
|
15
14
|
from collections.abc import AsyncIterator
|
|
16
15
|
from typing import (
|
|
17
16
|
TYPE_CHECKING,
|
|
@@ -587,23 +586,6 @@ class WebsocketWrapperFastAPI:
|
|
|
587
586
|
async def close(self, code: int = 1000, reason: Optional[str] = None) -> None:
|
|
588
587
|
await self._websocket.close(code=code, reason=reason)
|
|
589
588
|
|
|
590
|
-
async def receive(self) -> Union[str, bytes]:
|
|
591
|
-
try:
|
|
592
|
-
import fastapi
|
|
593
|
-
except ImportError:
|
|
594
|
-
raise utils.make_optional_import_error("fastapi")
|
|
595
|
-
|
|
596
|
-
message = await self._websocket.receive()
|
|
597
|
-
|
|
598
|
-
if message.get("type") == "websocket.disconnect":
|
|
599
|
-
# NB(nikhil): Mimics FastAPI `_raise_on_disconnect`, since otherwise the user has no
|
|
600
|
-
# way of detecting that the client disconnected.
|
|
601
|
-
raise fastapi.WebSocketDisconnect(message["code"], message.get("reason"))
|
|
602
|
-
elif message.get("text"):
|
|
603
|
-
return typing.cast(str, message["text"])
|
|
604
|
-
else:
|
|
605
|
-
return typing.cast(bytes, message["bytes"])
|
|
606
|
-
|
|
607
589
|
async def receive_text(self) -> str:
|
|
608
590
|
return await self._websocket.receive_text()
|
|
609
591
|
|
truss/templates/train/config.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Import necessary classes from the Baseten Training SDK
|
|
2
|
-
from truss_train import definitions
|
|
3
|
-
from truss.base import truss_config
|
|
4
|
-
|
|
5
|
-
PROJECT_NAME = "My-Baseten-Training-Project"
|
|
6
|
-
NUM_NODES = 1
|
|
7
|
-
NUM_GPUS_PER_NODE = 1
|
|
8
|
-
|
|
9
|
-
# 1. Define a base image for your training job. You can also use
|
|
10
|
-
# private images via AWS IAM or GCP Service Account authentication.
|
|
11
|
-
BASE_IMAGE = "pytorch/pytorch:2.7.0-cuda12.8-cudnn9-runtime"
|
|
12
|
-
|
|
13
|
-
# 2. Define the Runtime Environment for the Training Job
|
|
14
|
-
# This includes start commands and environment variables.
|
|
15
|
-
# Secrets from the baseten workspace like API keys are referenced using
|
|
16
|
-
# `SecretReference`.
|
|
17
|
-
training_runtime = definitions.Runtime(
|
|
18
|
-
start_commands=[ # Example: list of commands to run your training script
|
|
19
|
-
"/bin/sh -c 'chmod +x ./run.sh && ./run.sh'"
|
|
20
|
-
],
|
|
21
|
-
environment_variables={
|
|
22
|
-
# "HF_TOKEN": definitions.SecretReference(name="hf_access_token"),
|
|
23
|
-
"HELLO": "WORLD"
|
|
24
|
-
},
|
|
25
|
-
cache_config=definitions.CacheConfig(
|
|
26
|
-
enabled=False # Set to True to enable caching between runs
|
|
27
|
-
),
|
|
28
|
-
checkpointing_config=definitions.CheckpointingConfig(
|
|
29
|
-
enabled=False # Set to True to enable saving checkpoints on Baseten
|
|
30
|
-
),
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
training_compute = definitions.Compute(
|
|
34
|
-
node_count=NUM_NODES,
|
|
35
|
-
accelerator=truss_config.AcceleratorSpec(
|
|
36
|
-
accelerator=truss_config.Accelerator.H100, count=NUM_GPUS_PER_NODE
|
|
37
|
-
),
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
training_job = definitions.TrainingJob(
|
|
41
|
-
image=definitions.Image(base_image=BASE_IMAGE),
|
|
42
|
-
compute=training_compute,
|
|
43
|
-
runtime=training_runtime,
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
training_project = definitions.TrainingProject(name=PROJECT_NAME, job=training_job)
|
truss/templates/train/run.sh
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Exit immediately if a command exits with a non-zero status
|
|
4
|
-
set -eux
|
|
5
|
-
|
|
6
|
-
echo "Initializing model training environment..."
|
|
7
|
-
# TODO: Call your training logic below
|
|
8
|
-
echo "Placeholder: insert your model training logic below."
|
|
9
|
-
# e.g., python train_model.py --config config.yaml --epochs 10
|
|
10
|
-
|
|
11
|
-
echo "Training process completed (placeholder)."
|