Spaces:
Runtime error
Runtime error
Shivam29rathore
commited on
Commit
•
f91af0c
1
Parent(s):
da65d6b
Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,13 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
2 |
import pickle
|
3 |
|
4 |
|
5 |
-
|
6 |
checkpoint = "my_t5.sav"
|
7 |
|
8 |
#load model from drive
|
9 |
with open(checkpoint, "rb") as f:
|
10 |
-
model= pickle.load(f)
|
11 |
-
|
12 |
#tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
13 |
#model = AutoModelForSeq2SeqLM.from_pretrained(checkpoint)
|
14 |
|
|
|
2 |
import pickle
|
3 |
|
4 |
|
5 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
6 |
checkpoint = "my_t5.sav"
|
7 |
|
8 |
#load model from drive
|
9 |
with open(checkpoint, "rb") as f:
|
10 |
+
model= pickle.load(f, map_location='cpu')
|
11 |
+
|
12 |
#tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
13 |
#model = AutoModelForSeq2SeqLM.from_pretrained(checkpoint)
|
14 |
|