File tree Expand file tree Collapse file tree 1 file changed +17
-19
lines changed Expand file tree Collapse file tree 1 file changed +17
-19
lines changed Original file line number Diff line number Diff line change @@ -37,26 +37,24 @@ def get(
37
37
raise HTTPError (
38
38
400 , Errors .MISSING_REQUIRED_PARAMETER .format ("model_format" )
39
39
)
40
- try :
41
- model_format = model_format .upper ()
42
- except ValueError as err :
43
- raise AquaValueError (f"Invalid model format: { model_format } " ) from err
40
+
41
+ model_format = model_format .upper ()
42
+
43
+ if os_path :
44
+ return self .finish (
45
+ AquaModelApp .get_model_files (os_path , model_format )
46
+ )
47
+ elif model_name :
48
+ return self .finish (
49
+ AquaModelApp .get_hf_model_files (model_name , model_format )
50
+ )
44
51
else :
45
- if os_path :
46
- return self .finish (
47
- AquaModelApp .get_model_files (os_path , model_format )
48
- )
49
- elif model_name :
50
- return self .finish (
51
- AquaModelApp .get_hf_model_files (model_name , model_format )
52
- )
53
- else :
54
- raise HTTPError (
55
- 400 ,
56
- Errors .MISSING_ONEOF_REQUIRED_PARAMETER .format (
57
- "os_path" , "model_name"
58
- ),
59
- )
52
+ raise HTTPError (
53
+ 400 ,
54
+ Errors .MISSING_ONEOF_REQUIRED_PARAMETER .format (
55
+ "os_path" , "model_name"
56
+ ),
57
+ )
60
58
elif not model_id :
61
59
return self .list ()
62
60
You can’t perform that action at this time.
0 commit comments