未验证 提交 256f13ca 编写于 作者: 小湉湉's avatar 小湉湉 提交者: GitHub

Merge pull request #2269 from yt605155624/r1.1

[cherry-pick][r.1.1]fix stats bugs
...@@ -125,9 +125,11 @@ class StatsCommand: ...@@ -125,9 +125,11 @@ class StatsCommand:
"Here is the list of {} pretrained models released by PaddleSpeech that can be used by command line and python API" "Here is the list of {} pretrained models released by PaddleSpeech that can be used by command line and python API"
.format(self.task.upper())) .format(self.task.upper()))
self.show_support_models(pretrained_models) self.show_support_models(pretrained_models)
return True
except BaseException: except BaseException:
print("Failed to get the list of {} pretrained models.".format( print("Failed to get the list of {} pretrained models.".format(
self.task.upper())) self.task.upper()))
return False
# Dynamic import when running specific command # Dynamic import when running specific command
......
...@@ -18,7 +18,6 @@ from typing import List ...@@ -18,7 +18,6 @@ from typing import List
import uvicorn import uvicorn
from fastapi import FastAPI from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
from prettytable import PrettyTable from prettytable import PrettyTable
from starlette.middleware.cors import CORSMiddleware from starlette.middleware.cors import CORSMiddleware
...@@ -46,6 +45,7 @@ app.add_middleware( ...@@ -46,6 +45,7 @@ app.add_middleware(
allow_methods=["*"], allow_methods=["*"],
allow_headers=["*"]) allow_headers=["*"])
@cli_server_register( @cli_server_register(
name='paddlespeech_server.start', description='Start the service') name='paddlespeech_server.start', description='Start the service')
class ServerExecutor(BaseExecutor): class ServerExecutor(BaseExecutor):
...@@ -177,7 +177,7 @@ class ServerStatsExecutor(): ...@@ -177,7 +177,7 @@ class ServerStatsExecutor():
logger.info( logger.info(
"Here is the table of {} static pretrained models supported in the service.". "Here is the table of {} static pretrained models supported in the service.".
format(self.task.upper())) format(self.task.upper()))
self.show_support_models(pretrained_models) self.show_support_models(static_pretrained_models)
return True return True
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册