Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,10 @@
|
|
|
|
1 |
from transformers import pipeline
|
2 |
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
text = "This is a long text that needs summarization."
|
6 |
|
|
|
1 |
+
import torch
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
# Force the model to use CPU explicitly
|
5 |
+
device = torch.device("cpu")
|
6 |
+
|
7 |
+
summarizer = pipeline("summarization", model="t5-base", device=-1) # -1 ensures CPU usage
|
8 |
|
9 |
text = "This is a long text that needs summarization."
|
10 |
|