Update README.md
Browse files
README.md
CHANGED
@@ -8,7 +8,6 @@ language:
|
|
8 |
pipeline_tag: image-to-text
|
9 |
---
|
10 |
|
11 |
-
|
12 |
## Model Details
|
13 |
|
14 |
### Model Description
|
@@ -16,8 +15,6 @@ pipeline_tag: image-to-text
|
|
16 |
- **Developed by:** [https://huggingface.co/Mit1208]
|
17 |
- **Finetuned from model:** [microsoft/kosmos-2-patch14-224]
|
18 |
|
19 |
-
[More Information Needed]
|
20 |
-
|
21 |
## Training Details
|
22 |
https://github.com/mit1280/fined-tuning/blob/main/Kosmos_2_fine_tune_PokemonCards_trl.ipynb
|
23 |
|
@@ -26,10 +23,13 @@ https://github.com/mit1280/fined-tuning/blob/main/kosmos2_fine_tuned_inference.i
|
|
26 |
|
27 |
### How to Use
|
28 |
```python
|
29 |
-
# Load model directly
|
30 |
from transformers import AutoProcessor, Kosmos2ForConditionalGeneration
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-
|
33 |
my_model = Kosmos2ForConditionalGeneration.from_pretrained("Mit1208/Kosmos-2-PokemonCards-trl-merged", device_map="auto",low_cpu_mem_usage=True)
|
34 |
|
35 |
# load image
|
|
|
8 |
pipeline_tag: image-to-text
|
9 |
---
|
10 |
|
|
|
11 |
## Model Details
|
12 |
|
13 |
### Model Description
|
|
|
15 |
- **Developed by:** [https://huggingface.co/Mit1208]
|
16 |
- **Finetuned from model:** [microsoft/kosmos-2-patch14-224]
|
17 |
|
|
|
|
|
18 |
## Training Details
|
19 |
https://github.com/mit1280/fined-tuning/blob/main/Kosmos_2_fine_tune_PokemonCards_trl.ipynb
|
20 |
|
|
|
23 |
|
24 |
### How to Use
|
25 |
```python
|
|
|
26 |
from transformers import AutoProcessor, Kosmos2ForConditionalGeneration
|
27 |
+
import torch
|
28 |
+
from io import BytesIO
|
29 |
+
import requests
|
30 |
+
from PIL import Image
|
31 |
|
32 |
+
processor = AutoProcessor.from_pretrained("microsoft/kosmos-2-patch14-224")
|
33 |
my_model = Kosmos2ForConditionalGeneration.from_pretrained("Mit1208/Kosmos-2-PokemonCards-trl-merged", device_map="auto",low_cpu_mem_usage=True)
|
34 |
|
35 |
# load image
|