update readme.
Browse files- README.md +2 -0
- demo.ipynb +3 -3
README.md
CHANGED
@@ -69,6 +69,8 @@ print("==> prediciton: ", prediction)
|
|
69 |
# output: ==> prediciton: There is one dog in the picture.
|
70 |
```
|
71 |
|
|
|
|
|
72 |
# License
|
73 |
|
74 |
Our code and weights are released under the Creative Commons Attribution Non Commercial 4.0 [LICENSE](LICENSE.txt).
|
|
|
69 |
# output: ==> prediciton: There is one dog in the picture.
|
70 |
```
|
71 |
|
72 |
+
More comprehenisve examples can be found in the [notebook](demo.ipynb).
|
73 |
+
|
74 |
# License
|
75 |
|
76 |
Our code and weights are released under the Creative Commons Attribution Non Commercial 4.0 [LICENSE](LICENSE.txt).
|
demo.ipynb
CHANGED
@@ -319,14 +319,14 @@
|
|
319 |
},
|
320 |
{
|
321 |
"cell_type": "code",
|
322 |
-
"execution_count":
|
323 |
"metadata": {},
|
324 |
"outputs": [
|
325 |
{
|
326 |
"name": "stdout",
|
327 |
"output_type": "stream",
|
328 |
"text": [
|
329 |
-
"==> prediciton: There is one dog in the picture
|
330 |
]
|
331 |
}
|
332 |
],
|
@@ -346,7 +346,7 @@
|
|
346 |
" do_sample=False, max_new_tokens=768, top_p=None, num_beams=1,\n",
|
347 |
" stopping_criteria = [EosListStoppingCriteria()],\n",
|
348 |
" )\n",
|
349 |
-
"prediction = tokenizer.decode(generated_text[0], skip_special_tokens=True)\n",
|
350 |
"print(\"==> prediciton: \", prediction)\n",
|
351 |
"# output: ==> prediciton: There is one dog in the picture."
|
352 |
]
|
|
|
319 |
},
|
320 |
{
|
321 |
"cell_type": "code",
|
322 |
+
"execution_count": 6,
|
323 |
"metadata": {},
|
324 |
"outputs": [
|
325 |
{
|
326 |
"name": "stdout",
|
327 |
"output_type": "stream",
|
328 |
"text": [
|
329 |
+
"==> prediciton: There is one dog in the picture. \n"
|
330 |
]
|
331 |
}
|
332 |
],
|
|
|
346 |
" do_sample=False, max_new_tokens=768, top_p=None, num_beams=1,\n",
|
347 |
" stopping_criteria = [EosListStoppingCriteria()],\n",
|
348 |
" )\n",
|
349 |
+
"prediction = tokenizer.decode(generated_text[0], skip_special_tokens=True).split(\"<|end|>\")[0]\n",
|
350 |
"print(\"==> prediciton: \", prediction)\n",
|
351 |
"# output: ==> prediciton: There is one dog in the picture."
|
352 |
]
|