Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,13 @@ import torch
|
|
2 |
from transformers import (T5ForConditionalGeneration,T5Tokenizer)
|
3 |
import gradio as gr
|
4 |
|
5 |
-
best_model_path = "aditi2222/
|
6 |
model = T5ForConditionalGeneration.from_pretrained(best_model_path)
|
7 |
-
tokenizer = T5Tokenizer.from_pretrained("aditi2222/
|
8 |
|
9 |
def tokenize_data(text):
|
10 |
# Tokenize the review body
|
11 |
-
input_ =
|
12 |
max_len = 64
|
13 |
# tokenize inputs
|
14 |
tokenized_inputs = tokenizer(input_, padding='max_length', truncation=True, max_length=max_len, return_attention_mask=True, return_tensors='pt')
|
|
|
2 |
from transformers import (T5ForConditionalGeneration,T5Tokenizer)
|
3 |
import gradio as gr
|
4 |
|
5 |
+
best_model_path = "aditi2222/paragus_models"
|
6 |
model = T5ForConditionalGeneration.from_pretrained(best_model_path)
|
7 |
+
tokenizer = T5Tokenizer.from_pretrained("aditi2222/paragus_models")
|
8 |
|
9 |
def tokenize_data(text):
|
10 |
# Tokenize the review body
|
11 |
+
input_ = str(text) + ' </s>'
|
12 |
max_len = 64
|
13 |
# tokenize inputs
|
14 |
tokenized_inputs = tokenizer(input_, padding='max_length', truncation=True, max_length=max_len, return_attention_mask=True, return_tensors='pt')
|