Skip to content

Commit 0c81b2f

Browse files
tastelikefeetJintao-Huang
authored andcommitted
Fix two UI bugs (#512)
1 parent a025967 commit 0c81b2f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

swift/ui/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def get_choices_from_dataclass(dataclass):
159159
for f in fields(dataclass):
160160
if 'choices' in f.metadata:
161161
choice_dict[f.name] = f.metadata['choices']
162-
if 'Literal' in type(f.type).__name__ and typing.get_args(f.type):
162+
if 'Literal' in str(f.type) and typing.get_args(f.type):
163163
choice_dict[f.name] = typing.get_args(f.type)
164164
return choice_dict
165165

swift/ui/llm_train/runtime.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import time
44
import webbrowser
55
from datetime import datetime
6-
from functools import partial
7-
from typing import Dict, List, Tuple, Type, Union
6+
from typing import Dict, List, Tuple, Type
87

98
import gradio as gr
109
import matplotlib.pyplot as plt
@@ -398,7 +397,8 @@ def parse_info_from_cmdline(task):
398397
args = [arg.strip() for arg in args.split('--') if arg.strip()]
399398
all_args = {}
400399
for i in range(len(args)):
401-
splits = args[i].split(' ')
400+
space = args[i].find(' ')
401+
splits = args[i][:space], args[i][space + 1:]
402402
all_args[splits[0]] = splits[1]
403403
return all_args
404404

0 commit comments

Comments
 (0)