2
2
"cells" : [
3
3
{
4
4
"cell_type" : " markdown" ,
5
- "source" : [
6
- " ### Download and Install Dependencies"
7
- ],
8
5
"metadata" : {
9
6
"id" : " fwxJqHJiiYHX"
10
- }
7
+ },
8
+ "source" : [
9
+ " ### Download and Install Dependencies"
10
+ ]
11
11
},
12
12
{
13
13
"cell_type" : " code" ,
14
14
"execution_count" : null ,
15
15
"metadata" : {
16
+ "collapsed" : true ,
16
17
"id" : " _7D67c3Sc7Aa"
17
18
},
18
19
"outputs" : [],
49
50
"cell_type" : " code" ,
50
51
"execution_count" : null ,
51
52
"metadata" : {
53
+ "collapsed" : true ,
52
54
"id" : " foOxhxatc7Ad"
53
55
},
54
56
"outputs" : [],
79
81
"outputs" : [],
80
82
"source" : [
81
83
" model = \" textattack/bert-base-uncased-rotten-tomatoes\" # @param {type:\" string\" }\n " ,
84
+ " task = \" text-classification\" # @param {type:\" string\" }\n " ,
82
85
" user = \" codewithkyrian\" # @param {type:\" string\" }"
83
86
]
84
87
},
96
99
"cell_type" : " code" ,
97
100
"execution_count" : null ,
98
101
"metadata" : {
102
+ "collapsed" : true ,
99
103
"id" : " AZgFlpvdc7Ae"
100
104
},
101
105
"outputs" : [],
102
106
"source" : [
103
107
" os.makedirs(\" models\" , exist_ok=True)\n " ,
104
- " !python convert.py --quantize --model_id $model"
108
+ " !python convert.py --quantize --model_id $model --task $task "
105
109
]
106
110
},
107
111
{
108
112
"cell_type" : " markdown" ,
109
- "source" : [
110
- " ### Upload Converted model to 🤗 Hub"
111
- ],
112
113
"metadata" : {
113
114
"id" : " sZ6Hna1xikyk"
114
- }
115
+ },
116
+ "source" : [
117
+ " ### Upload Converted model to 🤗 Hub"
118
+ ]
115
119
},
116
120
{
117
121
"cell_type" : " code" ,
118
122
"execution_count" : null ,
119
123
"metadata" : {
120
- "colab" : {
121
- "base_uri" : " https://localhost:8080/"
122
- },
123
- "id" : " 6TWHZV29c7Ae" ,
124
- "outputId" : " 06171614-95a7-48c1-822f-5cbbf20ec260"
125
- },
126
- "outputs" : [
127
- {
128
- "output_type" : " stream" ,
129
- "name" : " stdout" ,
130
- "text" : [
131
- " Repo ID: codewithkyrian/bert-base-uncased-rotten-tomatoes\n "
132
- ]
133
- }
134
- ],
124
+ "id" : " 6TWHZV29c7Ae"
125
+ },
126
+ "outputs" : [],
135
127
"source" : [
136
128
" model_name = model.split(\" /\" )[-1]\n " ,
137
129
" repo_id = f\" {user}/{model_name}\" # new repo id with user\n " ,
178
170
" card_meta['library_name'] = \" Transformers PHP\"\n " ,
179
171
" card_meta.setdefault('tags', []) # sometimes, tags key doesn't exist\n " ,
180
172
" card_meta['tags'] += [\" onnx\" ]\n " ,
173
+ " card_meta['pipeline_tag'] = task\n " ,
181
174
" card_meta = ModelCardData(**card_meta)"
182
175
]
183
176
},
200
193
" {card.text}\n " ,
201
194
" ---\n " ,
202
195
" \n " ,
203
- " Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using [🤗 Optimum](https://huggingface.co/docs/optimum/index) and structuring your repo like this one (with ONNX weights located in a subfolder named `onnx`).\n " ,
196
+ " Note: Having a separate repo for ONNX weights is intended to be a temporary solution until ONNXRuntime gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using [🤗 Optimum](https://huggingface.co/docs/optimum/index) and structuring your repo like this one (with ONNX weights located in a subfolder named `onnx`).\n " ,
204
197
" \"\"\" "
205
198
]
206
199
},
207
200
{
208
201
"cell_type" : " code" ,
209
202
"execution_count" : null ,
210
203
"metadata" : {
211
- "colab" : {
212
- "base_uri" : " https://localhost:8080/" ,
213
- "height" : 69
214
- },
215
- "id" : " t364cswtc7Af" ,
216
- "outputId" : " 1d4eef30-db03-4c71-baae-de17ee2adef7"
217
- },
218
- "outputs" : [
219
- {
220
- "output_type" : " execute_result" ,
221
- "data" : {
222
- "text/plain" : [
223
- " CommitInfo(commit_url='https://huggingface.co/codewithkyrian/bert-base-uncased-rotten-tomatoes/commit/2a2a5c72c5b6365ff17a01c4ec3330566fea3855', commit_message='Upload README.md with huggingface_hub', commit_description='', oid='2a2a5c72c5b6365ff17a01c4ec3330566fea3855', pr_url=None, pr_revision=None, pr_num=None)"
224
- ],
225
- "application/vnd.google.colaboratory.intrinsic+json" : {
226
- "type" : " string"
227
- }
228
- },
229
- "metadata" : {},
230
- "execution_count" : 22
231
- }
232
- ],
204
+ "id" : " t364cswtc7Af"
205
+ },
206
+ "outputs" : [],
233
207
"source" : [
234
208
" ModelCard(content).push_to_hub(repo_id) # push the new model card to the hub"
235
209
]
236
210
}
237
211
],
238
212
"metadata" : {
239
- "language_info" : {
240
- "name" : " python"
241
- },
242
213
"colab" : {
243
- "provenance" : [],
244
- "toc_visible" : true
214
+ "provenance" : []
245
215
},
246
216
"kernelspec" : {
247
- "name" : " python3" ,
248
- "display_name" : " Python 3"
217
+ "display_name" : " Python 3" ,
218
+ "name" : " python3"
219
+ },
220
+ "language_info" : {
221
+ "name" : " python"
249
222
}
250
223
},
251
224
"nbformat" : 4 ,
252
225
"nbformat_minor" : 0
253
- }
226
+ }
0 commit comments