Update README.md
Browse files
README.md
CHANGED
|
@@ -100,12 +100,18 @@ generation_config = dict(
|
|
| 100 |
do_sample=False,
|
| 101 |
)
|
| 102 |
|
|
|
|
| 103 |
question = "请详细描述图片"
|
| 104 |
-
response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
print(question, response)
|
| 106 |
|
| 107 |
question = "请根据图片写一首诗"
|
| 108 |
-
response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history)
|
| 109 |
print(question, response)
|
| 110 |
```
|
| 111 |
|
|
|
|
| 100 |
do_sample=False,
|
| 101 |
)
|
| 102 |
|
| 103 |
+
# single-round conversation
|
| 104 |
question = "请详细描述图片"
|
| 105 |
+
response = model.chat(tokenizer, pixel_values, question, generation_config)
|
| 106 |
+
print(question, response)
|
| 107 |
+
|
| 108 |
+
# multi-round conversation
|
| 109 |
+
question = "请详细描述图片"
|
| 110 |
+
response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=None, return_history=True)
|
| 111 |
print(question, response)
|
| 112 |
|
| 113 |
question = "请根据图片写一首诗"
|
| 114 |
+
response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history, return_history=True)
|
| 115 |
print(question, response)
|
| 116 |
```
|
| 117 |
|