Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
machineuser
commited on
Commit
·
5da0ad7
1
Parent(s):
871c193
Sync widgets demo
Browse files
packages/tasks/src/library-ui-elements.ts
CHANGED
@@ -187,12 +187,8 @@ const paddlenlp = (model: ModelData) => {
|
|
187 |
[
|
188 |
`from paddlenlp.transformers import AutoTokenizer, ${architecture}`,
|
189 |
"",
|
190 |
-
`tokenizer = AutoTokenizer.from_pretrained("${model.id}"
|
191 |
-
|
192 |
-
}, from_hf_hub=True)`,
|
193 |
-
`model = ${architecture}.from_pretrained("${model.id}"${
|
194 |
-
model.private ? ", use_auth_token=True" : ""
|
195 |
-
}, from_hf_hub=True)`,
|
196 |
].join("\n"),
|
197 |
];
|
198 |
} else {
|
@@ -201,12 +197,8 @@ const paddlenlp = (model: ModelData) => {
|
|
201 |
`# ⚠️ Type of model unknown`,
|
202 |
`from paddlenlp.transformers import AutoTokenizer, AutoModel`,
|
203 |
"",
|
204 |
-
`tokenizer = AutoTokenizer.from_pretrained("${model.id}"
|
205 |
-
|
206 |
-
}, from_hf_hub=True)`,
|
207 |
-
`model = AutoModel.from_pretrained("${model.id}"${
|
208 |
-
model.private ? ", use_auth_token=True" : ""
|
209 |
-
}, from_hf_hub=True)`,
|
210 |
].join("\n"),
|
211 |
];
|
212 |
}
|
|
|
187 |
[
|
188 |
`from paddlenlp.transformers import AutoTokenizer, ${architecture}`,
|
189 |
"",
|
190 |
+
`tokenizer = AutoTokenizer.from_pretrained("${model.id}", from_hf_hub=True)`,
|
191 |
+
`model = ${architecture}.from_pretrained("${model.id}", from_hf_hub=True)`,
|
|
|
|
|
|
|
|
|
192 |
].join("\n"),
|
193 |
];
|
194 |
} else {
|
|
|
197 |
`# ⚠️ Type of model unknown`,
|
198 |
`from paddlenlp.transformers import AutoTokenizer, AutoModel`,
|
199 |
"",
|
200 |
+
`tokenizer = AutoTokenizer.from_pretrained("${model.id}", from_hf_hub=True)`,
|
201 |
+
`model = AutoModel.from_pretrained("${model.id}", from_hf_hub=True)`,
|
|
|
|
|
|
|
|
|
202 |
].join("\n"),
|
203 |
];
|
204 |
}
|