Update README.md
Browse files
README.md
CHANGED
@@ -130,12 +130,18 @@ generation_config = dict(
|
|
130 |
do_sample=False,
|
131 |
)
|
132 |
|
|
|
133 |
question = "请详细描述图片"
|
134 |
-
response
|
|
|
|
|
|
|
|
|
|
|
135 |
print(question, response)
|
136 |
|
137 |
question = "请根据图片写一首诗"
|
138 |
-
response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history)
|
139 |
print(question, response)
|
140 |
```
|
141 |
|
|
|
130 |
do_sample=False,
|
131 |
)
|
132 |
|
133 |
+
# single-round conversation
|
134 |
question = "请详细描述图片"
|
135 |
+
response = model.chat(tokenizer, pixel_values, question, generation_config)
|
136 |
+
print(question, response)
|
137 |
+
|
138 |
+
# multi-round conversation
|
139 |
+
question = "请详细描述图片"
|
140 |
+
response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=None, return_history=True)
|
141 |
print(question, response)
|
142 |
|
143 |
question = "请根据图片写一首诗"
|
144 |
+
response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history, return_history=True)
|
145 |
print(question, response)
|
146 |
```
|
147 |
|