Update README for small model
Browse files
README.md
CHANGED
@@ -46,6 +46,10 @@ a fast character-based sentence and paragraph boundary detection system optimize
|
|
46 |
|
47 |
## Usage
|
48 |
|
|
|
|
|
|
|
|
|
49 |
```python
|
50 |
from huggingface_hub import hf_hub_download
|
51 |
from charboundary import TextSegmenter
|
@@ -53,8 +57,8 @@ from charboundary import TextSegmenter
|
|
53 |
# Download the model
|
54 |
model_path = hf_hub_download(repo_id="alea-institute/charboundary-small", filename="model.pkl")
|
55 |
|
56 |
-
# Load the model
|
57 |
-
segmenter = TextSegmenter.load(model_path)
|
58 |
|
59 |
# Use the model
|
60 |
text = "This is a test sentence. Here's another one!"
|
|
|
46 |
|
47 |
## Usage
|
48 |
|
49 |
+
> **Important:** When loading models from Hugging Face Hub, you must set `trust_model=True` to allow loading custom class types.
|
50 |
+
>
|
51 |
+
> **Security Note:** The ONNX model variants are recommended in security-sensitive environments as they don't require bypassing skops security measures with `trust_model=True`. See the [ONNX versions](https://huggingface.co/alea-institute/charboundary-small-onnx) for a safer alternative.
|
52 |
+
|
53 |
```python
|
54 |
from huggingface_hub import hf_hub_download
|
55 |
from charboundary import TextSegmenter
|
|
|
57 |
# Download the model
|
58 |
model_path = hf_hub_download(repo_id="alea-institute/charboundary-small", filename="model.pkl")
|
59 |
|
60 |
+
# Load the model (trust_model=True is required when loading from external sources)
|
61 |
+
segmenter = TextSegmenter.load(model_path, trust_model=True)
|
62 |
|
63 |
# Use the model
|
64 |
text = "This is a test sentence. Here's another one!"
|