Spaces:
Sleeping
Sleeping
Update
Browse files
app.py
CHANGED
@@ -146,7 +146,7 @@ def load_or_train_model():
|
|
146 |
if os.path.exists(model_path):
|
147 |
try:
|
148 |
model = T5ForConditionalGeneration.from_pretrained(model_path)
|
149 |
-
tokenizer = T5Tokenizer.from_pretrained(model_path)
|
150 |
if torch.cuda.is_available():
|
151 |
model = model.cuda()
|
152 |
return model, tokenizer
|
@@ -160,8 +160,8 @@ def train_model():
|
|
160 |
"""Train the T5 model on travel planning data"""
|
161 |
try:
|
162 |
# Initialize model and tokenizer
|
163 |
-
tokenizer = T5Tokenizer.from_pretrained('t5-base')
|
164 |
-
model = T5ForConditionalGeneration.from_pretrained('t5-base')
|
165 |
|
166 |
# Create or load training data
|
167 |
if os.path.exists('travel_data.csv'):
|
|
|
146 |
if os.path.exists(model_path):
|
147 |
try:
|
148 |
model = T5ForConditionalGeneration.from_pretrained(model_path)
|
149 |
+
tokenizer = T5Tokenizer.from_pretrained(model_path, legacy=False)
|
150 |
if torch.cuda.is_available():
|
151 |
model = model.cuda()
|
152 |
return model, tokenizer
|
|
|
160 |
"""Train the T5 model on travel planning data"""
|
161 |
try:
|
162 |
# Initialize model and tokenizer
|
163 |
+
tokenizer = T5Tokenizer.from_pretrained('t5-base', legacy=False)
|
164 |
+
model = T5ForConditionalGeneration.from_pretrained('t5-base', legacy=False)
|
165 |
|
166 |
# Create or load training data
|
167 |
if os.path.exists('travel_data.csv'):
|