versae commited on
Commit
774b58a
·
1 Parent(s): 978af14

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -4
README.md CHANGED
@@ -43,14 +43,12 @@ This repo contains models for the identification of language in text (also refer
43
  After download, the models can be used through the Fasttext library:
44
 
45
  ```python
 
46
  import fasttext
47
- from datasets.utils.download_manager import DownloadManager
48
 
49
-
50
- NORDIC_LID_URL = "https://huggingface.co/NbAiLab/nb-nordic-lid/resolve/main/"
51
  model_name = "nb-nordic-lid.ftz"
 
52
 
53
- model = fasttext.load_model(DownloadManager().download(NORDIC_LID_URL + model_name))
54
  model.predict("Debatt er bra og sunt for demokratier, og en forutsetning for politikkutvikling.", threshold=0.25)
55
  # (('__label__nob',), array([0.95482141]))
56
  ```
 
43
  After download, the models can be used through the Fasttext library:
44
 
45
  ```python
46
+ from huggingface_hub import hf_hub_download
47
  import fasttext
 
48
 
 
 
49
  model_name = "nb-nordic-lid.ftz"
50
+ model = fasttext.load_model(hf_hub_download("NbAiLab/nb-nordic-lid", model_name))
51
 
 
52
  model.predict("Debatt er bra og sunt for demokratier, og en forutsetning for politikkutvikling.", threshold=0.25)
53
  # (('__label__nob',), array([0.95482141]))
54
  ```