Improve exception type.
ImportError isn't really appropriate when there's no import involved.
This commit is contained in:
@@ -107,7 +107,7 @@ class ServeCommand(BaseTransformersCLICommand):
|
||||
self._host = host
|
||||
self._port = port
|
||||
if not _serve_dependancies_installed:
|
||||
raise ImportError(
|
||||
raise RuntimeError(
|
||||
"Using serve command requires FastAPI and unicorn. "
|
||||
"Please install transformers with [serving]: pip install transformers[serving]."
|
||||
"Or install FastAPI and unicorn separatly."
|
||||
|
||||
Reference in New Issue
Block a user