Skip to content

Commit

Permalink
noqa
Browse files Browse the repository at this point in the history
  • Loading branch information
markus583 committed Jun 16, 2024
1 parent 3f3ad11 commit fceca3f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
ruff --output-format=github --select=E9,F63,F7,F82 --ignore=E722 --target-version=py37 .
ruff --output-format=github --select=E9,F63,F7,F82 --target-version=py37 .
# default set of ruff rules with GitHub Annotations
ruff --output-format=github --target-version=py37 .
- name: Test with pytest
Expand Down
2 changes: 1 addition & 1 deletion adapters/tests/test_encoder_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import adapters
from hf_transformers.tests.models.encoder_decoder.test_modeling_encoder_decoder import * # Imported to execute model tests
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, BertConfig
from transformers.testing_utils import require_torch, torch_device
from transformers.testing_utils import require_torch

from .methods import (
BottleneckAdapterTestMixin,
Expand Down
2 changes: 1 addition & 1 deletion wtpsplit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def __init__(
# merge lora weights into transformer for 0 efficiency overhead
self.model.model.merge_adapter("sat-lora")
self.use_lora = True
except:
except: # noqa
if lora_path:
print(f"LoRA at {lora_path} not found, using base model...")
else:
Expand Down
2 changes: 1 addition & 1 deletion wtpsplit/data_acquisition/extract_all_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def corrupt_asr(sentences, lang):

try:
tokenizer = MosesTokenizer(lang)
except:
except: # noqa
corrupted_sentences = [
preprocess_sentence("".join([char for char in sentence if char not in punct_chars]).lower())
for sentence in sentences
Expand Down
2 changes: 1 addition & 1 deletion wtpsplit/evaluation/intrinsic_ted.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def main(args):
):
try:
model_path = os.path.join(args.model_path, os.listdir(args.model_path)[0], "en")
except:
except: # noqa
model_path = args.model_path
print(model_path)
else:
Expand Down
2 changes: 1 addition & 1 deletion wtpsplit/evaluation/llm_sentence.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def align_llm_output(row):
)
# same as aligned_in, aligned_llm, but with additional formatting. Latter used to debug only.
formatted_alignment = alignment._format_alignment(aligned_in, aligned_llm).split("\n")
except: # ruff: ignore=E722
except: # noqa
print("Alignment failed: ", row.name)
formatted_alignment = [row["test_chunks"], "", " " * len(row["test_chunks"])]
return pd.Series(
Expand Down
2 changes: 1 addition & 1 deletion wtpsplit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def corrupt_asr(text: str, lang):
corrupted_sentences = [
tokenizer.detokenize(corrupted_tokens).lower() for corrupted_tokens in corrupted_tokenized_sentences
]
except:
except: # noqa
corrupted_sentences = [
"".join([char for char in sentence if char not in Constants.PUNCTUATION_CHARS]).lower()
for sentence in sentences
Expand Down

0 comments on commit fceca3f

Please sign in to comment.