Sarah Ciston
commited on
Commit
·
52330f2
1
Parent(s):
6eb0047
add back awaits to model processing
Browse files
README.md
CHANGED
@@ -6,8 +6,8 @@ colorTo: blue
|
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
models:
|
9 |
-
- distilroberta-base
|
10 |
- bert-base-uncased
|
|
|
11 |
|
12 |
|
13 |
# hf_oauth: true
|
|
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
models:
|
|
|
9 |
- bert-base-uncased
|
10 |
+
- distilroberta-base
|
11 |
|
12 |
|
13 |
# hf_oauth: true
|
sketch.js
CHANGED
@@ -7,7 +7,7 @@ import { pipeline, env } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers
|
|
7 |
env.allowLocalModels = false;
|
8 |
|
9 |
/// AUTHORIZATION
|
10 |
-
// import { textGeneration } from 'https://esm.sh/@huggingface/inference';
|
11 |
// import { oauthLoginUrl, oauthHandleRedirectIfPresent } from 'https://esm.sh/@huggingface/[email protected]';
|
12 |
|
13 |
// const oauthResult = await oauthHandleRedirectIfPresent();
|
@@ -369,12 +369,12 @@ async function runModel(PROMPT){
|
|
369 |
|
370 |
let unmasker = await pipeline('fill-mask', MODELNAME)
|
371 |
|
372 |
-
let res = unmasker(PROMPT)
|
373 |
// , top_k=5
|
374 |
|
375 |
console.log(res[0].sequence, res[0].token_str, res[1].sequence, res[1].token_str)
|
376 |
|
377 |
-
var modelResult = res
|
378 |
|
379 |
return modelResult
|
380 |
|
|
|
7 |
env.allowLocalModels = false;
|
8 |
|
9 |
/// AUTHORIZATION
|
10 |
+
// import { textGeneration } from 'https://esm.sh/@huggingface/inference@2.7.0/+esm';
|
11 |
// import { oauthLoginUrl, oauthHandleRedirectIfPresent } from 'https://esm.sh/@huggingface/[email protected]';
|
12 |
|
13 |
// const oauthResult = await oauthHandleRedirectIfPresent();
|
|
|
369 |
|
370 |
let unmasker = await pipeline('fill-mask', MODELNAME)
|
371 |
|
372 |
+
let res = await unmasker(PROMPT)
|
373 |
// , top_k=5
|
374 |
|
375 |
console.log(res[0].sequence, res[0].token_str, res[1].sequence, res[1].token_str)
|
376 |
|
377 |
+
var modelResult = await res
|
378 |
|
379 |
return modelResult
|
380 |
|