timpal0l commited on
Commit
2ce3d85
1 Parent(s): b5b2295

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -1
README.md CHANGED
@@ -17,8 +17,11 @@ pipeline_tag: text-generation
17
 
18
  # How to use:
19
  ```python
 
20
  from transformers import pipeline
21
- pipe = pipeline("text-generation", "timpal0l/tyr", device="cuda:0")
 
 
22
 
23
  query = "Vad är grundlagen?"
24
 
 
17
 
18
  # How to use:
19
  ```python
20
+ import torch
21
  from transformers import pipeline
22
+
23
+ device = "cuda" if torch.cuda.is_available() else "cpu"
24
+ pipe = pipeline("text-generation", "timpal0l/tyr", device=device)
25
 
26
  query = "Vad är grundlagen?"
27