Skip to content

Commit 57ab2a1

Browse files
fix app-ui (#2765)
1 parent 6488cba commit 57ab2a1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

swift/ui/app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ def run(self):
8787
if is_gradio_app:
8888
from swift.utils import find_free_port
8989
LLMInfer.element('port').value = str(find_free_port())
90+
for f in fields(self.args):
91+
if getattr(self.args, f.name) and f.name in LLMInfer.elements() and hasattr(
92+
LLMInfer.elements()[f.name], 'value') and f.name != 'port':
93+
value = getattr(self.args, f.name)
94+
if isinstance(value, list):
95+
value = ' '.join([v or '' for v in value])
96+
LLMInfer.elements()[f.name].value = value
9097
app.load(LLMInfer.deploy_model, list(LLMInfer.valid_elements().values()),
9198
[LLMInfer.element('runtime_tab'),
9299
LLMInfer.element('running_tasks')])

swift/ui/llm_infer/llm_infer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def deploy_model(cls, *args):
297297
time.sleep(1)
298298
cnt += 1
299299
if cnt >= 60:
300-
logger.warn(f'Deploy costing too much time, please check log file: {log_file}')
300+
logger.warning_once(f'Deploy costing too much time, please check log file: {log_file}')
301301
logger.info('Deploy done.')
302302
cls.deployed = True
303303
running_task = Runtime.refresh_tasks(log_file)

0 commit comments

Comments
 (0)