Update README.md
Browse files
README.md
CHANGED
|
@@ -59,18 +59,4 @@ Recommended repository files:
|
|
| 59 |
- `requirements.txt`: required Python libraries
|
| 60 |
- `inference_example.py`: example inference script
|
| 61 |
|
| 62 |
-
## Usage
|
| 63 |
|
| 64 |
-
This model uses a custom PyTorch architecture, so it is not directly loadable using `AutoModel.from_pretrained()` unless a custom Hugging Face Transformers wrapper is added.
|
| 65 |
-
|
| 66 |
-
Example loading format:
|
| 67 |
-
|
| 68 |
-
```python
|
| 69 |
-
import torch
|
| 70 |
-
from model import BiXLSTMCRF
|
| 71 |
-
|
| 72 |
-
checkpoint = torch.load("checkpoint.pt", map_location="cpu")
|
| 73 |
-
|
| 74 |
-
model = BiXLSTMCRF(**checkpoint["config"])
|
| 75 |
-
model.load_state_dict(checkpoint["model_state_dict"])
|
| 76 |
-
model.eval()
|
|
|
|
| 59 |
- `requirements.txt`: required Python libraries
|
| 60 |
- `inference_example.py`: example inference script
|
| 61 |
|
|
|
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|