Gabriele Morello commited on
Commit
51b98f5
·
1 Parent(s): 2f82031

changed device

Browse files
Files changed (2) hide show
  1. .DS_Store +0 -0
  2. app.py +1 -0
.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]