Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -2
src/streamlit_app.py
CHANGED
|
@@ -4,6 +4,10 @@ import nltk
|
|
| 4 |
import math
|
| 5 |
import torch
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
model_name = "Timur1984/t5-base-title-generation"
|
| 8 |
max_input_length = 512
|
| 9 |
|
|
@@ -16,8 +20,6 @@ def load_model():
|
|
| 16 |
print("Loading model...")
|
| 17 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 18 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
| 19 |
-
nltk.download('punkt')
|
| 20 |
-
nltk.download('punkt_tab')
|
| 21 |
print("Model loaded!")
|
| 22 |
return tokenizer, model
|
| 23 |
|
|
|
|
| 4 |
import math
|
| 5 |
import torch
|
| 6 |
|
| 7 |
+
|
| 8 |
+
nltk.download('punkt')
|
| 9 |
+
nltk.download('punkt_tab')
|
| 10 |
+
|
| 11 |
model_name = "Timur1984/t5-base-title-generation"
|
| 12 |
max_input_length = 512
|
| 13 |
|
|
|
|
| 20 |
print("Loading model...")
|
| 21 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 22 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
|
|
|
|
|
|
| 23 |
print("Model loaded!")
|
| 24 |
return tokenizer, model
|
| 25 |
|