Spaces:
Runtime error
Runtime error
cpu mode
Browse files
models/t5_small_medium_title_generation.py
CHANGED
|
@@ -4,7 +4,7 @@ import torch
|
|
| 4 |
|
| 5 |
def t5model(prompt: str) -> str:
|
| 6 |
tokenizer = AutoTokenizer.from_pretrained("fabiochiu/t5-small-medium-title-generation")
|
| 7 |
-
model = AutoModelForSeq2SeqLM.from_pretrained("fabiochiu/t5-small-medium-title-generation", torch_dtype=torch.
|
| 8 |
inputs = tokenizer(
|
| 9 |
["summarize:" + prompt],
|
| 10 |
return_tensors="pt",
|
|
|
|
| 4 |
|
| 5 |
def t5model(prompt: str) -> str:
|
| 6 |
tokenizer = AutoTokenizer.from_pretrained("fabiochiu/t5-small-medium-title-generation")
|
| 7 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("fabiochiu/t5-small-medium-title-generation", torch_dtype=torch.float32)
|
| 8 |
inputs = tokenizer(
|
| 9 |
["summarize:" + prompt],
|
| 10 |
return_tensors="pt",
|