File size: 3,315 Bytes
1516d79 7a9835e 1516d79 7a9835e 1516d79 7a9835e 1516d79 7a9835e 1516d79 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "482c2cab-2174-4ab9-bd15-bdd21abe8900",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<a href='pytorch_model.bin' target='_blank'>pytorch_model.bin</a><br>"
],
"text/plain": [
"/workspace/vit5/pytorch_model.bin"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from IPython.display import FileLink, FileLinks\n",
"FileLink('pytorch_model.bin')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "4314353d-9e70-40ae-a8a8-5c13b6322612",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9f61e56a4f16415d86ac9e8c1460cba7",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HTML(value='<center> <img\\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.sv…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from huggingface_hub import notebook_login\n",
"\n",
"notebook_login()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "ac1a68a6-8286-4da2-bd8a-0d480127e0cb",
"metadata": {},
"outputs": [],
"source": [
"from transformers import AutoModelForSeq2SeqLM, AutoTokenizer\n",
"model = AutoModelForSeq2SeqLM.from_pretrained(\"/workspace/vit5/checkpoint-10466\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "059f7512-2173-4b39-8fbf-cde2403d430e",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "10e90ef5c1304b94ae5c5cd9f74ab072",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"pytorch_model.bin: 0%| | 0.00/904M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"model.push_to_hub(\"trientp/vit5_base_qa\")"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "fe57b8c3-33ae-49ac-af4c-01a5cdf36831",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"CommitInfo(commit_url='https://huggingface.co/trientp/vit5_base_qa/commit/5259b65a3fb4645bbc5ee242d18253c58a6c0a89', commit_message='Upload tokenizer', commit_description='', oid='5259b65a3fb4645bbc5ee242d18253c58a6c0a89', pr_url=None, pr_revision=None, pr_num=None)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"tokenizer = AutoTokenizer.from_pretrained(\"VietAI/vit5-base\") \n",
"tokenizer.push_to_hub(\"trientp/vit5_base_qa\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|