Alexandre-Numind commited on
Commit
5e52f36
·
verified ·
1 Parent(s): 9eb3ee1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -301,20 +301,20 @@ def highlight_words(input_text, json_output):
301
 
302
  return highlighted_text
303
 
304
- # model = AutoModelForCausalLM.from_pretrained(
305
- # "numind/NuExtract-tinyv2",
306
- # )
307
 
308
  model = AutoModelForCausalLM.from_pretrained(
309
  "numind/NuExtract",
310
  trust_remote_code=True,
 
 
 
311
  )
312
 
313
 
314
  tokenizer = AutoTokenizer.from_pretrained("numind/NuExtract")
315
  tokenizer.eos = tokenizer("<|end-output|>")
316
 
317
- model.to("cuda")
318
  model.eval()
319
 
320
 
 
301
 
302
  return highlighted_text
303
 
304
+
 
 
305
 
306
  model = AutoModelForCausalLM.from_pretrained(
307
  "numind/NuExtract",
308
  trust_remote_code=True,
309
+ device_map="cuda",
310
+ torch_dtype="auto",
311
+ attn_implementation="flash_attention_2"
312
  )
313
 
314
 
315
  tokenizer = AutoTokenizer.from_pretrained("numind/NuExtract")
316
  tokenizer.eos = tokenizer("<|end-output|>")
317
 
 
318
  model.eval()
319
 
320