Move mypy config into pyproject.toml. Ignore 2 remaining mypy issues

This commit is contained in:
Debanjum Singh Solanky
2023-02-16 03:33:08 -06:00
parent 7a9a811874
commit 8b293edd7c
4 changed files with 18 additions and 16 deletions

View File

@@ -216,7 +216,7 @@ def deduplicate_results(entries: List[Entry], hits: List[dict]) -> List[dict]:
with timer("Deduplication Time", logger, state.device):
seen, original_hits_count = set(), len(hits)
hits = [hit for hit in hits
if entries[hit['corpus_id']].raw not in seen and not seen.add(entries[hit['corpus_id']].raw)]
if entries[hit['corpus_id']].raw not in seen and not seen.add(entries[hit['corpus_id']].raw)] # type: ignore[func-returns-value]
duplicate_hits = original_hits_count - len(hits)
logger.debug(f"Removed {duplicate_hits} duplicates")

View File

@@ -27,7 +27,7 @@ search_index_lock = threading.Lock()
if torch.cuda.is_available():
# Use CUDA GPU
device = torch.device("cuda:0")
elif version.parse(torch.__version__) >= version.parse("1.13.0.dev") and torch.backends.mps.is_available():
elif version.parse(torch.__version__) >= version.parse("1.13.0.dev") and torch.backends.mps.is_available(): # type: ignore[attr-defined]
# Use Apple M1 Metal Acceleration
device = torch.device("mps")
else: