Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -108,11 +108,12 @@ def sliding_window_prediction(template, text, model, tokenizer, window_size=4000
|
|
| 108 |
|
| 109 |
# Load the model and tokenizer
|
| 110 |
model_name = "numind/NuExtract-v1.5"
|
|
|
|
| 111 |
model = AutoModelForCausalLM.from_pretrained(model_name,
|
| 112 |
trust_remote_code=True,
|
| 113 |
torch_dtype=torch.bfloat16,
|
| 114 |
-
device_map="auto")
|
| 115 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 116 |
model.eval()
|
| 117 |
|
| 118 |
def gradio_interface_function(template, text):
|
|
|
|
| 108 |
|
| 109 |
# Load the model and tokenizer
|
| 110 |
model_name = "numind/NuExtract-v1.5"
|
| 111 |
+
auth_token = os.environ.get("HF_TOKEN") or True
|
| 112 |
model = AutoModelForCausalLM.from_pretrained(model_name,
|
| 113 |
trust_remote_code=True,
|
| 114 |
torch_dtype=torch.bfloat16,
|
| 115 |
+
device_map="auto", use_auth_token=auth_token)
|
| 116 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, use_auth_token=auth_token)
|
| 117 |
model.eval()
|
| 118 |
|
| 119 |
def gradio_interface_function(template, text):
|