Update README.md
Browse files
README.md
CHANGED
|
@@ -43,6 +43,7 @@ To use the model:
|
|
| 43 |
|
| 44 |
```python
|
| 45 |
import json
|
|
|
|
| 46 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 47 |
|
| 48 |
def predict_NuExtract(model, tokenizer, texts, template, batch_size=1, max_length=10_000, max_new_tokens=4_000):
|
|
@@ -60,7 +61,7 @@ def predict_NuExtract(model, tokenizer, texts, template, batch_size=1, max_lengt
|
|
| 60 |
|
| 61 |
return [output.split("<|output|>")[1] for output in outputs]
|
| 62 |
|
| 63 |
-
model_name = "numind/NuExtract-
|
| 64 |
device = "cuda"
|
| 65 |
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, trust_remote_code=True).to(device).eval()
|
| 66 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
|
|
|
| 43 |
|
| 44 |
```python
|
| 45 |
import json
|
| 46 |
+
import torch
|
| 47 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 48 |
|
| 49 |
def predict_NuExtract(model, tokenizer, texts, template, batch_size=1, max_length=10_000, max_new_tokens=4_000):
|
|
|
|
| 61 |
|
| 62 |
return [output.split("<|output|>")[1] for output in outputs]
|
| 63 |
|
| 64 |
+
model_name = "numind/NuExtract-1.5-smol"
|
| 65 |
device = "cuda"
|
| 66 |
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, trust_remote_code=True).to(device).eval()
|
| 67 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|