Skip to content

Commit

Permalink
fix requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
dahaipeng committed Aug 1, 2024
1 parent 6f9ae6a commit 894afca
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
23 changes: 12 additions & 11 deletions modelscope_agent/tools/code_interpreter/code_interpreter_nb.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
import json
import json5
import nbformat
from jupyter_client import BlockingKernelClient
from modelscope_agent.tools.base import BaseTool, register_tool
from modelscope_agent.utils.utils import extract_code
from nbclient import NotebookClient
from nbclient.exceptions import CellTimeoutError, DeadKernelError
from nbformat import NotebookNode
from nbformat.v4 import new_code_cell, new_markdown_cell, new_output
from rich.box import MINIMAL
from rich.console import Console, Group
from rich.live import Live
from rich.markdown import Markdown
from rich.panel import Panel
from rich.syntax import Syntax

try:
from nbclient import NotebookClient
from nbclient.exceptions import CellTimeoutError, DeadKernelError
from nbformat import NotebookNode
from nbformat.v4 import new_code_cell, new_markdown_cell, new_output
from rich.console import Console
from rich.syntax import Syntax
except ImportError:
raise ImportError(
'Please install nbclient, nbformat, rich by running `pip install nbclient nbformat rich`'
)


@register_tool('code_interpreter')
Expand Down
14 changes: 10 additions & 4 deletions modelscope_agent/tools/metagpt_tools/libs/data_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
import numpy as np
import pandas as pd
from modelscope_agent.tools.metagpt_tools.tool_registry import register_tool
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import (LabelEncoder, MaxAbsScaler, MinMaxScaler,
OneHotEncoder, OrdinalEncoder, RobustScaler,
StandardScaler)

try:
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import (LabelEncoder, MaxAbsScaler,
MinMaxScaler, OneHotEncoder,
OrdinalEncoder, RobustScaler,
StandardScaler)
except ImportError:
raise ImportError(
'Please install scikit-learn by running `pip install scikit-learn`')

TAGS = ['data preprocessing', 'machine learning']

Expand Down
13 changes: 9 additions & 4 deletions modelscope_agent/tools/metagpt_tools/libs/feature_engineering.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
from joblib import Parallel, delayed
from modelscope_agent.tools.metagpt_tools.libs.data_preprocess import MLProcess
from modelscope_agent.tools.metagpt_tools.tool_registry import register_tool
from pandas.core.dtypes.common import is_object_dtype
from sklearn.feature_selection import VarianceThreshold
from sklearn.model_selection import KFold
from sklearn.preprocessing import KBinsDiscretizer, PolynomialFeatures

try:
from pandas.core.dtypes.common import is_object_dtype
from sklearn.feature_selection import VarianceThreshold
from sklearn.model_selection import KFold
from sklearn.preprocessing import KBinsDiscretizer, PolynomialFeatures
except ImportError:
raise ImportError(
'Please install scikit-learn by running `pip install scikit-learn`')

TAGS = ['feature engineering', 'machine learning']

Expand Down

0 comments on commit 894afca

Please sign in to comment.