File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed
Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -608,7 +608,9 @@ def toggle_partition_params(method):
608608 )
609609
610610 submit_btn .click (
611- lambda * args : run_graphgen (WebuiParams .from_list (args )),
611+ lambda * args : run_graphgen (
612+ WebuiParams (** dict (zip (WebuiParams .__annotations__ , args )))
613+ ),
612614 inputs = [
613615 if_trainee_model ,
614616 upload_file ,
Original file line number Diff line number Diff line change 1- from dataclasses import dataclass , fields
1+ from dataclasses import dataclass
22from typing import Any
33
44
@@ -35,13 +35,3 @@ class WebuiParams:
3535 rpm : int
3636 tpm : int
3737 token_counter : Any
38-
39- @classmethod
40- def from_list (cls , args ):
41- """
42- args: a list/tuple of values corresponding to the fields in order.
43- """
44- field_names = [f .name for f in fields (cls )]
45- if len (args ) != len (field_names ):
46- raise ValueError (f"Expected { len (field_names )} arguments, got { len (args )} " )
47- return cls (** dict (zip (field_names , args )))
You can’t perform that action at this time.
0 commit comments