Update README.md
Browse files
README.md
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
---
|
2 |
license: mit
|
3 |
-
datasets:
|
4 |
-
- ydshieh/coco_dataset_script
|
5 |
language:
|
6 |
- en
|
7 |
metrics:
|
@@ -26,8 +24,9 @@ This is a sequence to sequence model for image-captioning. The architecture is <
|
|
26 |
The way to download and run this:
|
27 |
## Your code here
|
28 |
```python
|
|
|
29 |
from transformers import pipeline
|
30 |
-
image_captioner = pipeline("image-to-text", model="sadassa17/rgb-language_cap", max_new_tokens=200)
|
31 |
filename = 'path/to/file'
|
32 |
generated_captions = image_captioner(filename)
|
33 |
print(generated_captions)
|
|
|
1 |
---
|
2 |
license: mit
|
|
|
|
|
3 |
language:
|
4 |
- en
|
5 |
metrics:
|
|
|
24 |
The way to download and run this:
|
25 |
## Your code here
|
26 |
```python
|
27 |
+
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
28 |
from transformers import pipeline
|
29 |
+
image_captioner = pipeline("image-to-text", model="sadassa17/rgb-language_cap", max_new_tokens=200, device=device)
|
30 |
filename = 'path/to/file'
|
31 |
generated_captions = image_captioner(filename)
|
32 |
print(generated_captions)
|