Update README.md
Browse files
README.md
CHANGED
@@ -29,6 +29,9 @@ gen_kwargs = {
|
|
29 |
'eos_token_id': tokenizer.eos_token_id # this is a must since transformers ~4.37
|
30 |
}
|
31 |
|
|
|
|
|
|
|
32 |
response, history = model.chat(
|
33 |
texts='What is in the image?',
|
34 |
images=['https://cdn-icons-png.flaticon.com/256/6028/6028690.png'],
|
@@ -36,14 +39,19 @@ response, history = model.chat(
|
|
36 |
**gen_kwargs
|
37 |
)
|
38 |
|
|
|
39 |
print(response)
|
|
|
|
|
40 |
# response:
|
41 |
# The image contains a large, stylized "HI!" in a bright pink color with yellow outlines. The "HI!" is placed within a speech bubble shape.
|
42 |
|
43 |
# history:
|
44 |
# [['What is in the image?', 'The image contains a large, stylized "HI!" in a bright pink color with yellow outlines. The "HI!" is placed within a speech bubble shape.']]
|
45 |
|
46 |
-
|
|
|
|
|
47 |
response, history = model.chat(
|
48 |
texts='Are you sure?',
|
49 |
images=['https://cdn-icons-png.flaticon.com/256/6028/6028690.png'], # images need to be passed again in multi-round conversations
|
@@ -52,7 +60,10 @@ response, history = model.chat(
|
|
52 |
**gen_kwargs
|
53 |
)
|
54 |
|
|
|
55 |
print(response)
|
|
|
|
|
56 |
# response:
|
57 |
# Yes, I'm certain. The image is a graphic representation of the word "HI!" in a speech bubble.
|
58 |
|
|
|
29 |
'eos_token_id': tokenizer.eos_token_id # this is a must since transformers ~4.37
|
30 |
}
|
31 |
|
32 |
+
#################################################################################
|
33 |
+
# first round
|
34 |
+
#################################################################################
|
35 |
response, history = model.chat(
|
36 |
texts='What is in the image?',
|
37 |
images=['https://cdn-icons-png.flaticon.com/256/6028/6028690.png'],
|
|
|
39 |
**gen_kwargs
|
40 |
)
|
41 |
|
42 |
+
print('response:')
|
43 |
print(response)
|
44 |
+
print('history:')
|
45 |
+
print(history)
|
46 |
# response:
|
47 |
# The image contains a large, stylized "HI!" in a bright pink color with yellow outlines. The "HI!" is placed within a speech bubble shape.
|
48 |
|
49 |
# history:
|
50 |
# [['What is in the image?', 'The image contains a large, stylized "HI!" in a bright pink color with yellow outlines. The "HI!" is placed within a speech bubble shape.']]
|
51 |
|
52 |
+
#################################################################################
|
53 |
+
# second round
|
54 |
+
#################################################################################
|
55 |
response, history = model.chat(
|
56 |
texts='Are you sure?',
|
57 |
images=['https://cdn-icons-png.flaticon.com/256/6028/6028690.png'], # images need to be passed again in multi-round conversations
|
|
|
60 |
**gen_kwargs
|
61 |
)
|
62 |
|
63 |
+
print('response:')
|
64 |
print(response)
|
65 |
+
print('history:')
|
66 |
+
print(history)
|
67 |
# response:
|
68 |
# Yes, I'm certain. The image is a graphic representation of the word "HI!" in a speech bubble.
|
69 |
|