Skip to content
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pip install "git+https://github.com/TakoData/QueryFilter.git#egg=tako-query-filt

### Prerequisites
- Get access to Tako Hugging Face repositories
- Install and init `git-lfs`
- Log into Hugging Face using `huggingface-cli login`

### Examples
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ joblib = "1.4.2"
jupyter = "1.1.1"
nbstripout = "0.7.1"
numpy = "1.26.4"
python = ">=3.10.14,<4.0"
python = ">=3.10.14,<3.13"
scikit-learn = "1.4.1.post1"
sentence-transformers = {version = "3.0.1", optional = true}
spacy = {version = "3.7.5"}
Expand Down
6 changes: 2 additions & 4 deletions src/tako_query_filter/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
from typing import Iterable, List, Optional, Set
from sklearn.linear_model import LogisticRegressionCV
from huggingface_hub import hf_hub_download
from huggingface_hub import hf_hub_download, snapshot_download
import spacy
from spacy.language import Language

Expand Down Expand Up @@ -40,13 +40,11 @@ def load_from_hf(
force_download=force_download,
)
)
spacy_model_path = hf_hub_download(
spacy_model_dir = snapshot_download(
repo_id="TakoData/ner-model-best",
filename="config.cfg",
revision=spacy_revision,
force_download=force_download,
)
spacy_model_dir = str(Path(spacy_model_path).parent)
spacy_model = spacy.load(spacy_model_dir)
keywords_file = hf_hub_download(
repo_id=scikit_path,
Expand Down