mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
linting for controller
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user