@@ -36,6 +36,16 @@ def is_port_available(port: int) -> bool:
36
36
return
37
37
38
38
39
+ # Reset the custom __new__ and __init__ methods for TrajectoryGroup
40
+ def __new__ (cls , * args : Any , ** kwargs : Any ) -> TrajectoryGroup :
41
+ return pydantic .BaseModel .__new__ (cls )
42
+
43
+ def __init__ (self , * args : Any , ** kwargs : Any ) -> None :
44
+ return pydantic .BaseModel .__init__ (self , * args , ** kwargs )
45
+
46
+ TrajectoryGroup .__new__ = __new__ # type: ignore
47
+ TrajectoryGroup .__init__ = __init__
48
+
39
49
40
50
backend = LocalBackend ()
41
51
app = FastAPI ()
@@ -141,7 +151,7 @@ async def _experimental_deploy(
141
151
uvicorn .run (app , host = host , port = port , loop = "asyncio" )
142
152
143
153
@app .command ()
144
- def delete (project_name : str , model_name : str ):
154
+ def delete_model (project_name : str , model_name : str ):
145
155
"""Move a model to the trash."""
146
156
try :
147
157
delete_model (project_name , model_name )
@@ -150,7 +160,7 @@ def delete(project_name: str, model_name: str):
150
160
print (e )
151
161
152
162
@app .command ()
153
- def list_trashed_models (project_name : str ):
163
+ def list_trash (project_name : str ):
154
164
"""List models in the trash."""
155
165
trashed_models = list_trash (project_name )
156
166
if not trashed_models :
@@ -170,7 +180,7 @@ def restore_model(project_name: str, model_name: str):
170
180
print (e )
171
181
172
182
@app .command ()
173
- def empty_trashed_models (project_name : str ):
183
+ def empty_trash (project_name : str ):
174
184
"""Permanently delete all models in the trash."""
175
185
empty_trash (project_name )
176
186
print ("Trash has been emptied." )
0 commit comments