Skip to content

Commit

Permalink
Chore: pre-commit autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Nov 21, 2023
1 parent f4117e4 commit bd06be9
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import numpy as np
import pandas as pd
from fuzzywuzzy import fuzz
from kpi_inference_data_pipeline.utils.utils import aggregate_csvs, clean_annotation
from kpi_inference_data_pipeline.utils.utils import (aggregate_csvs,
clean_annotation)

from .base_kpi_inference_curator import BaseKPIInferenceCurator

Expand Down
13 changes: 5 additions & 8 deletions data_extractor/code/model_pipeline/metrics_per_kpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
from farm.evaluation.metrics import squad_EM, squad_f1
from farm.infer import QAInferencer
from farm.modeling.predictions import QACandidate
from model_pipeline.config_qa_farm_train import (
QAFileConfig,
QAInferConfig,
QAModelConfig,
QAProcessorConfig,
QATokenizerConfig,
QATrainingConfig,
)
from model_pipeline.config_qa_farm_train import (QAFileConfig, QAInferConfig,
QAModelConfig,
QAProcessorConfig,
QATokenizerConfig,
QATrainingConfig)
from model_pipeline.utils.qa_metrics import relaxed_squad_f1


Expand Down
24 changes: 6 additions & 18 deletions data_extractor/code/model_pipeline/model_pipeline/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
from .config_farm_train import (
FileConfig,
InferConfig,
MLFlowConfig,
ModelConfig,
ProcessorConfig,
TokenizerConfig,
TrainingConfig,
)
from .config_qa_farm_train import (
QAFileConfig,
QAInferConfig,
QAMLFlowConfig,
QAModelConfig,
QAProcessorConfig,
QATokenizerConfig,
QATrainingConfig,
)
from .config_farm_train import (FileConfig, InferConfig, MLFlowConfig,
ModelConfig, ProcessorConfig, TokenizerConfig,
TrainingConfig)
from .config_qa_farm_train import (QAFileConfig, QAInferConfig, QAMLFlowConfig,
QAModelConfig, QAProcessorConfig,
QATokenizerConfig, QATrainingConfig)
from .farm_trainer import FARMTrainer
from .qa_farm_trainer import QAFARMTrainer
from .trainer_optuna import TrainerOptuna
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,15 @@
import torch
from flask import Flask, Response, request
from kpi_inference_data_pipeline import TextKPIInferenceCurator, config
from model_pipeline.config_farm_train import (
FileConfig,
InferConfig,
MLFlowConfig,
ModelConfig,
ProcessorConfig,
TokenizerConfig,
TrainingConfig,
)
from model_pipeline.config_qa_farm_train import (
QAFileConfig,
QAInferConfig,
QAMLFlowConfig,
QAModelConfig,
QAProcessorConfig,
QATokenizerConfig,
QATrainingConfig,
)
from model_pipeline.config_farm_train import (FileConfig, InferConfig,
MLFlowConfig, ModelConfig,
ProcessorConfig, TokenizerConfig,
TrainingConfig)
from model_pipeline.config_qa_farm_train import (QAFileConfig, QAInferConfig,
QAMLFlowConfig, QAModelConfig,
QAProcessorConfig,
QATokenizerConfig,
QATrainingConfig)
from model_pipeline.farm_trainer import FARMTrainer
from model_pipeline.qa_farm_trainer import QAFARMTrainer
from model_pipeline.relevance_infer import TextRelevanceInfer
Expand Down
11 changes: 2 additions & 9 deletions data_extractor/code/model_pipeline/model_pipeline/optuna_hyp.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import model_pipeline
import optuna
from model_pipeline import (
FARMTrainer,
FileConfig,
MLFlowConfig,
ModelConfig,
ProcessorConfig,
TokenizerConfig,
TrainingConfig,
)
from model_pipeline import (FARMTrainer, FileConfig, MLFlowConfig, ModelConfig,
ProcessorConfig, TokenizerConfig, TrainingConfig)


def objective(trial):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import config
import pandas as pd

# TODO:
from globals import *
from HTMLDirectory import *
Expand Down
1 change: 0 additions & 1 deletion data_extractor/code/tests/test_train_on_pdf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import shutil
import sys
import traceback

# types
import typing
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
import pytest
import s3_communication
import train_on_pdf
from tests.utils_test import (
create_multiple_xlsx_files,
create_single_xlsx_file,
write_to_file,
)
from tests.utils_test import (create_multiple_xlsx_files,
create_single_xlsx_file, write_to_file)
from train_on_pdf import convert_xls_to_csv


Expand Down
1 change: 0 additions & 1 deletion data_extractor/code/tests/test_utils/test_generate_text.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import shutil

# types
import typing
from pathlib import Path
Expand Down
4 changes: 2 additions & 2 deletions data_extractor/code/tests/test_utils/test_run_router.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import shutil

# types
import typing
from pathlib import Path
Expand All @@ -10,7 +9,8 @@
import requests_mock
import train_on_pdf
from _pytest.capture import CaptureFixture
from tests.test_utils.test_convert_xls_to_csv import prerequisites_convert_xls_to_csv
from tests.test_utils.test_convert_xls_to_csv import \
prerequisites_convert_xls_to_csv
from tests.test_utils.test_generate_text import prerequisites_generate_text
from train_on_pdf import run_router

Expand Down

0 comments on commit bd06be9

Please sign in to comment.