Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #255

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.2.0
rev: v1.5.5
hooks:
- id: remove-tabs

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
Expand All @@ -22,20 +22,20 @@ repos:
- id: debug-statements

- repo: https://github.com/pycqa/pydocstyle.git
rev: 6.1.1
rev: 6.3.0
hooks:
- id: pydocstyle

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v5.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.10.0
hooks:
- id: black

Expand All @@ -46,7 +46,7 @@ repos:
# - id: check-manifest

- repo: https://github.com/s-weigand/flake8-nb
rev: v0.4.0
rev: v0.5.3
hooks:
- id: flake8-nb
additional_dependencies: ['pep8-naming']
Expand Down
1 change: 1 addition & 0 deletions notebooks/demo2/cascade_mask_rcnn_hrnetv2p_w32_20e_v2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Model settings."""

model = dict(
type="CascadeRCNN",
# num_stages=3,
Expand Down
1 change: 1 addition & 0 deletions notebooks/demo2/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Default runtime config."""

import pathlib
import os
import yaml
Expand Down
1 change: 0 additions & 1 deletion notebooks/demo2/config_farm_train.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Config FARM Training."""


import pathlib
import os
from farm.modeling.prediction_head import TextClassificationHead
Expand Down
1 change: 0 additions & 1 deletion src/components/preprocessing/base_component.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""BaseComponent."""


from abc import ABC, abstractmethod


Expand Down
1 change: 0 additions & 1 deletion src/components/preprocessing/base_curator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""BaseCurator."""


import re
from abc import abstractmethod

Expand Down
2 changes: 1 addition & 1 deletion src/components/preprocessing/base_kpi_inference_curator.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def return_sliced_squad(self, squad_json, indices):
return {}

pdf2pars = defaultdict(list)
for (i1, i2) in indices:
for i1, i2 in indices:
pdf2pars[i1].append(i2)

data = []
Expand Down
1 change: 0 additions & 1 deletion src/components/preprocessing/curator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Curator."""


import glob
import logging

Expand Down
1 change: 0 additions & 1 deletion src/components/preprocessing/extractor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Extractor class."""


from .pdf_table_extractor import PDFTableExtractor
from .pdf_text_extractor import PDFTextExtractor
import logging
Expand Down
1 change: 1 addition & 0 deletions src/components/preprocessing/kpi_inference_curator.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def clean(self, df):
Args:
df (A pandas dataframe)
"""

# map kpi to question
def map_kpi(r):
try:
Expand Down
1 change: 0 additions & 1 deletion src/components/preprocessing/nq_curator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Processing nq curator."""


import logging
import os
from ast import literal_eval
Expand Down
1 change: 0 additions & 1 deletion src/components/preprocessing/nq_extractor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""NQExtractor."""


import json
import logging
import os
Expand Down
1 change: 0 additions & 1 deletion src/components/preprocessing/pdf_table_extractor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""PDFTableExtractor."""


from .base_component import BaseComponent
import os
from pdf2image import convert_from_path, pdfinfo_from_path
Expand Down
1 change: 0 additions & 1 deletion src/components/preprocessing/pdf_text_extractor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""PDFTextExtractor."""


import glob
import io
import json
Expand Down
1 change: 0 additions & 1 deletion src/components/preprocessing/text_curator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""TextCurator."""


import ast
import json
import logging
Expand Down
1 change: 0 additions & 1 deletion src/components/utils/cscdtabnet_checkpoint_url.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Cscdtabnet checkpoint URLs."""


checkpoint_url = {
"general_model.pth": "https://drive.google.com/uc?id=1-xfq5hDmFdKgbY9FSFTmhSlcb2p13RPn",
"icdar_13.pth": "https://drive.google.com/uc?id=1-mVr4UBicFk3mjUz5tsVPjQ4jzRtiT7V",
Expand Down
1 change: 0 additions & 1 deletion src/components/utils/nq_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""NQ utils."""


import re


Expand Down
1 change: 0 additions & 1 deletion src/components/utils/qa_metrics.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""QA metrics."""


import numpy as np
from farm.evaluation.metrics import squad_EM, squad_f1
from sklearn.metrics import confusion_matrix
Expand Down
1 change: 1 addition & 0 deletions src/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Data collection module."""

from .s3_communication import S3FileType, S3Communication # noqa F401
1 change: 1 addition & 0 deletions src/data/make_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Data collection code."""

import click
import logging
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/data/s3_communication.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""S3 communication tools."""

import os
import pathlib
import os.path as osp
Expand Down
1 change: 1 addition & 0 deletions src/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for models."""

from .farm_trainer import FARMTrainer
from .qa_farm_trainer import QAFARMTrainer
from .trainer_optuna import TrainerOptuna
Expand Down
1 change: 0 additions & 1 deletion src/models/farm_trainer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""FARM Trainer."""


import logging
import os

Expand Down
1 change: 0 additions & 1 deletion src/models/qa_farm_trainer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""QA Farm trainer."""


import logging
import json
import os
Expand Down
1 change: 0 additions & 1 deletion src/models/relevance_infer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""RelevanceInfer."""


import json
import logging
import os
Expand Down
7 changes: 3 additions & 4 deletions src/models/text_kpi_infer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Text KPI Inference."""


import glob
import logging
import os
Expand Down Expand Up @@ -61,9 +60,9 @@ def __init__(self, infer_config, n_best_per_sample=1):
self.model.model.prediction_heads[0].n_best_per_sample = n_best_per_sample
# If positive, this will boost "No Answer" as prediction.
# If negative, this will decrease the model from giving "No Answer" as prediction.
self.model.model.prediction_heads[
0
].no_ans_boost = self.infer_config.no_ans_boost
self.model.model.prediction_heads[0].no_ans_boost = (
self.infer_config.no_ans_boost
)
self.result_dir = self.infer_config.result_dir["Text"]
if not os.path.exists(self.result_dir):
os.makedirs(self.result_dir)
Expand Down