split imports

This commit is contained in:
martinb-bb
2023-02-24 16:23:02 -05:00
parent 54637611f6
commit 7a0151ac0b

View File

@@ -28,8 +28,7 @@ except ModuleNotFoundError:
try:
import whisper
from transformers import pipeline
import yt_dlp
import transformers
from whisper.tokenizer import LANGUAGES, TO_LANGUAGE_CODE
from openbb_terminal.forecast.whisper_utils import str2bool
@@ -38,11 +37,23 @@ try:
except ModuleNotFoundError:
raise ModuleNotFoundError(
"Please install whisper model. Instructions can be found here: \n"
"Please use poetry to install latest whisper model and dependencies. \n"
"poetry install -E forecast \n"
"\n"
"If you are not using poetry, please install whisper model. Instructions can be found here: \n"
"https://github.com/openai/whisper \n"
"Please install the transformers library with the following command: \n"
"pip install transformers \n"
"Please install the yt_dlp library with the following command: \n"
)
try:
import yt_dlp
except ModuleNotFoundError:
raise ModuleNotFoundError(
"Please use poetry to install latest yt-dlp library and dependencies. \n"
"poetry install -E forecast \n"
"\n"
"If you are not using poetry, please install the yt_dlp library with the following command: \n"
"pip install yt_dlp \n"
)