Update README.md
Browse files
README.md
CHANGED
|
@@ -26,7 +26,7 @@ gen_kwargs = {
|
|
| 26 |
'min_new_tokens': 20,
|
| 27 |
'max_new_tokens': 100,
|
| 28 |
'do_sample': False,
|
| 29 |
-
'eos_token_id': tokenizer.eos_token_id
|
| 30 |
}
|
| 31 |
|
| 32 |
response, history = model.chat(
|
|
@@ -36,13 +36,13 @@ response, history = model.chat(
|
|
| 36 |
**gen_kwargs
|
| 37 |
)
|
| 38 |
|
|
|
|
| 39 |
# response:
|
| 40 |
# The image contains a large, stylized "HI!" in a bright pink color with yellow outlines. The "HI!" is placed within a speech bubble shape.
|
| 41 |
|
| 42 |
# history:
|
| 43 |
# [['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.']]
|
| 44 |
|
| 45 |
-
print(response)
|
| 46 |
|
| 47 |
response, history = model.chat(
|
| 48 |
texts='Are you sure?',
|
|
|
|
| 26 |
'min_new_tokens': 20,
|
| 27 |
'max_new_tokens': 100,
|
| 28 |
'do_sample': False,
|
| 29 |
+
'eos_token_id': tokenizer.eos_token_id # this is a must since transformers ~4.37
|
| 30 |
}
|
| 31 |
|
| 32 |
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?',
|