Spaces:
Sleeping
Sleeping
Update models.py
Browse files
models.py
CHANGED
@@ -18,7 +18,7 @@ class Models():
|
|
18 |
#is it best to keep in memory why not pickle?
|
19 |
checkpoint = "Universal-NER/UniNER-7B-all"
|
20 |
|
21 |
-
ner_model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", torch_dtype=torch.
|
22 |
tokenizer = AutoTokenizer.from_pretrained("Universal-NER/UniNER-7B-all", use_fast=False, padding="max_length")
|
23 |
hf_pipeline = pipeline(
|
24 |
"text-generation", #task
|
|
|
18 |
#is it best to keep in memory why not pickle?
|
19 |
checkpoint = "Universal-NER/UniNER-7B-all"
|
20 |
|
21 |
+
ner_model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", torch_dtype=torch.float32, offload_folder="offload", offload_state_dict = True)
|
22 |
tokenizer = AutoTokenizer.from_pretrained("Universal-NER/UniNER-7B-all", use_fast=False, padding="max_length")
|
23 |
hf_pipeline = pipeline(
|
24 |
"text-generation", #task
|