Update README.md
Browse files
README.md
CHANGED
|
@@ -23,10 +23,10 @@ tuned_model = LlavaForConditionalGeneration.from_pretrained(
|
|
| 23 |
)
|
| 24 |
|
| 25 |
image_path = ""
|
| 26 |
-
prompt = ""
|
| 27 |
image = Image.open(image_path).convert("RGB")
|
| 28 |
inputs = processor(text=prompt, images=[image], return_tensors="pt").to("cuda")
|
| 29 |
-
|
| 30 |
generated_texts = processor.batch_decode(generated_ids, skip_special_tokens=True)
|
| 31 |
```
|
| 32 |
|
|
|
|
| 23 |
)
|
| 24 |
|
| 25 |
image_path = ""
|
| 26 |
+
prompt = f"USER: <image>\n你是个表情包专家,仔细观察、理解图片中的想表达的感觉,把这个感觉转换成关键词。\nASSISTANT:"
|
| 27 |
image = Image.open(image_path).convert("RGB")
|
| 28 |
inputs = processor(text=prompt, images=[image], return_tensors="pt").to("cuda")
|
| 29 |
+
generated_ids = tuned_model.generate(**inputs, max_new_tokens=MAX_LENGTH)
|
| 30 |
generated_texts = processor.batch_decode(generated_ids, skip_special_tokens=True)
|
| 31 |
```
|
| 32 |
|