Update README.md
Browse files
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.',
|