Skip to content

Commit

Permalink
Fix Flair model load
Browse files Browse the repository at this point in the history
  • Loading branch information
ali6parmak committed Jan 15, 2025
1 parent e06c20c commit aeeedee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/download_models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
from os import makedirs
from os.path import join, exists
from huggingface_hub import snapshot_download, hf_hub_download
from huggingface_hub import snapshot_download

from configuration import MODELS_PATH

Expand Down
6 changes: 3 additions & 3 deletions src/use_cases/GetFlairEntitiesUseCase.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from pathlib import Path
from flair.models import SequenceTagger
from configuration import ROOT_PATH
from flair.nn import Classifier
from configuration import MODELS_PATH
from domain.NamedEntity import NamedEntity
from flair.data import Sentence, Span
from domain.NamedEntityType import NamedEntityType

flair_model = SequenceTagger.load(Path(ROOT_PATH, "models", "flair", "pytorch_model.bin"))
flair_model = Classifier.load(Path(MODELS_PATH, "flair", "pytorch_model.bin"))


class GetFlairEntitiesUseCase:
Expand Down

0 comments on commit aeeedee

Please sign in to comment.