pfialho commited on
Commit
dcbe96b
·
verified ·
1 Parent(s): 5efbec9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -35,8 +35,8 @@ model_list = [
35
  def predict(text, target, chosen_model):
36
  model1 = tf.keras.models.load_model(chosen_model, custom_objects={"TFBertModel": TFBertModel})
37
  checkpoint = "neuralmind/bert-base-portuguese-cased"
38
- tokenizer = AutoTokenizer.from_pretrained(checkpoint, use_fast=True)
39
- tokpair = tokenizer(text, target, truncation=True, padding='max_length', return_tensors='np')
40
 
41
  outp = model1(tokpair)
42
 
 
35
  def predict(text, target, chosen_model):
36
  model1 = tf.keras.models.load_model(chosen_model, custom_objects={"TFBertModel": TFBertModel})
37
  checkpoint = "neuralmind/bert-base-portuguese-cased"
38
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint, use_fast=True, model_max_length=512)
39
+ tokpair = tokenizer(text, target, truncation=True, padding='max_length', return_tensors='np', return_token_type_ids=False)
40
 
41
  outp = model1(tokpair)
42