linting for controller

This commit is contained in:
martinb-bb
2023-02-28 14:18:00 -05:00
parent 3ca3405920
commit afb4883fd9
2 changed files with 13 additions and 24 deletions

View File

@@ -32,6 +32,7 @@ try:
from whisper.tokenizer import LANGUAGES, TO_LANGUAGE_CODE
from openbb_terminal.forecast.whisper_utils import str2bool
transformers_ver = transformers.__version__
# if imports are successful, set flag to True
WHISPER_AVAILABLE = True
@@ -46,17 +47,6 @@ except ModuleNotFoundError:
"pip install transformers \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"
)
import pandas as pd
import psutil
@@ -116,18 +106,6 @@ from openbb_terminal.forecast import (
trans_view,
whisper_model,
)
from openbb_terminal.helper_funcs import (
EXPORT_ONLY_FIGURES_ALLOWED,
EXPORT_ONLY_RAW_DATA_ALLOWED,
NO_EXPORT,
check_positive,
check_positive_float,
log_and_raise,
valid_date,
)
from openbb_terminal.menu import session
from openbb_terminal.parent_classes import BaseController
from openbb_terminal.rich_config import MenuText, console
logger = logging.getLogger(__name__)
empty_df = pd.DataFrame()

View File

@@ -8,7 +8,18 @@ import warnings
from typing import Optional
import whisper
import yt_dlp
try:
import yt_dlp
except ModuleNotFoundError as exc:
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"
) from exc
from huggingface_hub import scan_cache_dir
from tqdm import tqdm
from transformers import BartForConditionalGeneration, BartTokenizer, pipeline