Update README.md
Browse files
README.md
CHANGED
|
@@ -84,12 +84,18 @@ generation_config = dict(
|
|
| 84 |
do_sample=False,
|
| 85 |
)
|
| 86 |
|
|
|
|
| 87 |
question = "请详细描述图片"
|
| 88 |
-
response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
print(question, response)
|
| 90 |
|
| 91 |
question = "请根据图片写一首诗"
|
| 92 |
-
response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history)
|
| 93 |
print(question, response)
|
| 94 |
```
|
| 95 |
|
|
|
|
| 84 |
do_sample=False,
|
| 85 |
)
|
| 86 |
|
| 87 |
+
# single-round conversation
|
| 88 |
question = "请详细描述图片"
|
| 89 |
+
response = model.chat(tokenizer, pixel_values, question, generation_config)
|
| 90 |
+
print(question, response)
|
| 91 |
+
|
| 92 |
+
# multi-round conversation
|
| 93 |
+
question = "请详细描述图片"
|
| 94 |
+
response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=None, return_history=True)
|
| 95 |
print(question, response)
|
| 96 |
|
| 97 |
question = "请根据图片写一首诗"
|
| 98 |
+
response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history, return_history=True)
|
| 99 |
print(question, response)
|
| 100 |
```
|
| 101 |
|