Gleb Vinarskis
commited on
Commit
·
154ad0d
1
Parent(s):
4bb64da
super loading
Browse files
impresso_langident_wrapper.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from transformers import Pipeline
|
2 |
from transformers.pipelines import PIPELINE_REGISTRY
|
3 |
import floret
|
|
|
4 |
|
5 |
|
6 |
|
@@ -8,6 +9,13 @@ class Pipeline_One(Pipeline):
|
|
8 |
def __init__(self, model_path, **kwargs):
|
9 |
super().__init__(**kwargs) # Call the base class constructor
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
# Load the Floret model
|
12 |
self.model = floret.load_model(model_path)
|
13 |
|
|
|
1 |
from transformers import Pipeline
|
2 |
from transformers.pipelines import PIPELINE_REGISTRY
|
3 |
import floret
|
4 |
+
from huggingface_hub import hf_hub_download
|
5 |
|
6 |
|
7 |
|
|
|
9 |
def __init__(self, model_path, **kwargs):
|
10 |
super().__init__(**kwargs) # Call the base class constructor
|
11 |
|
12 |
+
repo_id = "Maslionok/pipeline1" # Change this to your repo name
|
13 |
+
filename = "LID-40-3-2000000-1-4.bin" # Name of the .bin file
|
14 |
+
branch = "main" # Change this to your branch name if needed
|
15 |
+
|
16 |
+
# Download the model file from Hugging Face
|
17 |
+
model_path = hf_hub_download(repo_id=repo_id, filename=filename, revision=branch)
|
18 |
+
|
19 |
# Load the Floret model
|
20 |
self.model = floret.load_model(model_path)
|
21 |
|