javi8979 commited on
Commit
e311045
1 Parent(s): 795d940

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -0
README.md CHANGED
@@ -186,6 +186,10 @@ model_id = 'BSC-LT/salamandraTA-2b'
186
  tokenizer = AutoTokenizer.from_pretrained(model_id)
187
  model = AutoModelForCausalLM.from_pretrained(model_id, attn_implementation='eager')
188
 
 
 
 
 
189
  # List of sentences to translate
190
  sentences = [
191
  'Ayer se fue, tomó sus cosas y se puso a navegar.',
 
186
  tokenizer = AutoTokenizer.from_pretrained(model_id)
187
  model = AutoModelForCausalLM.from_pretrained(model_id, attn_implementation='eager')
188
 
189
+ # Move the model to GPU
190
+ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
191
+ model = model.to(device)
192
+
193
  # List of sentences to translate
194
  sentences = [
195
  'Ayer se fue, tomó sus cosas y se puso a navegar.',