Skip to content

Commit

Permalink
Fix two UI bugs (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
tastelikefeet authored and Jintao-Huang committed Mar 8, 2024
1 parent a025967 commit 0c81b2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion swift/ui/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def get_choices_from_dataclass(dataclass):
for f in fields(dataclass):
if 'choices' in f.metadata:
choice_dict[f.name] = f.metadata['choices']
if 'Literal' in type(f.type).__name__ and typing.get_args(f.type):
if 'Literal' in str(f.type) and typing.get_args(f.type):
choice_dict[f.name] = typing.get_args(f.type)
return choice_dict

Expand Down
6 changes: 3 additions & 3 deletions swift/ui/llm_train/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import time
import webbrowser
from datetime import datetime
from functools import partial
from typing import Dict, List, Tuple, Type, Union
from typing import Dict, List, Tuple, Type

import gradio as gr
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -398,7 +397,8 @@ def parse_info_from_cmdline(task):
args = [arg.strip() for arg in args.split('--') if arg.strip()]
all_args = {}
for i in range(len(args)):
splits = args[i].split(' ')
space = args[i].find(' ')
splits = args[i][:space], args[i][space + 1:]
all_args[splits[0]] = splits[1]
return all_args

Expand Down

0 comments on commit 0c81b2f

Please sign in to comment.