Jellyfish042 commited on
Commit
9820b04
1 Parent(s): 9e572dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,8 +9,8 @@ def text_processing(text):
9
  inputs = [text]
10
 
11
  # Tokenize and prepare the inputs for model
12
- input_ids = tokenizer(inputs, return_tensors="pt", max_length=512, truncation=True, padding="max_length").input_ids.to(device)
13
- attention_mask = tokenizer(inputs, return_tensors="pt", max_length=512, truncation=True, padding="max_length").attention_mask.to(device)
14
 
15
  # Generate prediction
16
  output = model.generate(input_ids=input_ids, attention_mask=attention_mask, max_new_tokens=512)
 
9
  inputs = [text]
10
 
11
  # Tokenize and prepare the inputs for model
12
+ input_ids = tokenizer(inputs, return_tensors="pt", max_length=512, truncation=True, padding="max_length").input_ids
13
+ attention_mask = tokenizer(inputs, return_tensors="pt", max_length=512, truncation=True, padding="max_length").attention_mask
14
 
15
  # Generate prediction
16
  output = model.generate(input_ids=input_ids, attention_mask=attention_mask, max_new_tokens=512)