Update app.py
Browse files
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 |
|