Cutecat6152 commited on
Commit
54d3ce7
·
verified ·
1 Parent(s): 58872a2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -1
README.md CHANGED
@@ -17,7 +17,15 @@ import numpy as np
17
  import fasttext
18
  from huggingface_hub import hf_hub_download
19
 
20
- np.array = lambda obj, *args, **kwargs: np.asarray(obj, *args, **{k: v for k, v in kwargs.items() if k != "copy"})
 
 
 
 
 
 
 
 
21
 
22
  model_path = hf_hub_download(repo_id="Cutecat6152/OkayLID", filename="OkayLID.bin")
23
  model = fasttext.load_model(model_path)
 
17
  import fasttext
18
  from huggingface_hub import hf_hub_download
19
 
20
+ def setup_environment():
21
+ original_array = np.array
22
+ def fixed_array(obj, *args, **kwargs):
23
+ if kwargs.get("copy") is False:
24
+ return np.asarray(obj)
25
+ return original_array(obj, *args, **kwargs)
26
+ np.array = fixed_array
27
+
28
+ setup_environment()
29
 
30
  model_path = hf_hub_download(repo_id="Cutecat6152/OkayLID", filename="OkayLID.bin")
31
  model = fasttext.load_model(model_path)