Update README.md
Browse files
README.md
CHANGED
|
@@ -17,8 +17,11 @@ pipeline_tag: text-generation
|
|
| 17 |
|
| 18 |
# How to use:
|
| 19 |
```python
|
|
|
|
| 20 |
from transformers import pipeline
|
| 21 |
-
|
|
|
|
|
|
|
| 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 |
|