fix stats bugs

pull/2269/head
TianYuan 2 years ago
parent f2f09d8043
commit 307639d628

@ -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
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(
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():
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

Loading…
Cancel
Save