Spaces:
Sleeping
Sleeping
Gabriele Morello
commited on
Commit
·
51b98f5
1
Parent(s):
2f82031
changed device
Browse files
.DS_Store
CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
|
|
app.py
CHANGED
@@ -29,6 +29,7 @@ print(zero.device) # <-- 'cpu' 🤔
|
|
29 |
|
30 |
@spaces.GPU
|
31 |
def predict(text):
|
|
|
32 |
input_ids = tokenizer(text, return_tensors='pt')["input_ids"]
|
33 |
generated_ids = model.generate(input_ids, max_new_tokens=256)
|
34 |
filling = tokenizer.batch_decode(generated_ids[:, input_ids.shape[1]:], skip_special_tokens = True)[0]
|
|
|
29 |
|
30 |
@spaces.GPU
|
31 |
def predict(text):
|
32 |
+
model.to(zero.device)
|
33 |
input_ids = tokenizer(text, return_tensors='pt')["input_ids"]
|
34 |
generated_ids = model.generate(input_ids, max_new_tokens=256)
|
35 |
filling = tokenizer.batch_decode(generated_ids[:, input_ids.shape[1]:], skip_special_tokens = True)[0]
|