Update README.md
Browse files
README.md
CHANGED
|
@@ -17,7 +17,15 @@ import numpy as np
|
|
| 17 |
import fasttext
|
| 18 |
from huggingface_hub import hf_hub_download
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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)
|