Format-The-Codebase

- solve the conflict between black and isort
This commit is contained in:
Ömer Faruk Özdemir 2022-02-09 17:32:43 +03:00
parent 23af8e559c
commit 6a77a30a4a
5 changed files with 21 additions and 11 deletions

View File

@ -49,7 +49,7 @@ jobs:
- run:
command: |
. venv/bin/activate
python -m isort --check-only gradio test
python -m isort --profile=black --check-only gradio test
- run:
command: |
. venv/bin/activate

View File

@ -6,11 +6,19 @@ import math
import numpy as np
import torch
from pytorch_transformers import (WEIGHTS_NAME, BertConfig,
BertForQuestionAnswering, BertTokenizer)
from pytorch_transformers import (
WEIGHTS_NAME,
BertConfig,
BertForQuestionAnswering,
BertTokenizer,
)
from torch.utils.data import DataLoader, SequentialSampler, TensorDataset
from utils import (get_answer, input_to_squad_example,
squad_examples_to_features, to_list)
from utils import (
get_answer,
input_to_squad_example,
squad_examples_to_features,
to_list,
)
RawResult = collections.namedtuple(
"RawResult", ["unique_id", "start_logits", "end_logits"]

View File

@ -5,8 +5,7 @@ import math
import numpy as np
import torch
from pytorch_transformers.tokenization_bert import (BasicTokenizer,
whitespace_tokenize)
from pytorch_transformers.tokenization_bert import BasicTokenizer, whitespace_tokenize
from torch.utils.data import DataLoader, SequentialSampler, TensorDataset

View File

@ -1,7 +1,11 @@
import pkg_resources
from gradio.flagging import (CSVLogger, FlaggingCallback,
HuggingFaceDatasetSaver, SimpleCSVLogger)
from gradio.flagging import (
CSVLogger,
FlaggingCallback,
HuggingFaceDatasetSaver,
SimpleCSVLogger,
)
from gradio.interface import Interface, close_all, reset_all
from gradio.mix import Parallel, Series
from gradio.routes import get_state, set_state

View File

@ -6,8 +6,7 @@ import numpy as np
import gradio.interpretation
import gradio.test_data
from gradio import Interface
from gradio.processing_utils import (decode_base64_to_image,
encode_array_to_base64)
from gradio.processing_utils import decode_base64_to_image, encode_array_to_base64
os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"