Public
Edited
Apr 16, 2023
Insert cell
Insert cell
transformers = {
const proxy = htl.html`<iframe style="display:none">`;
console.log(proxy);
document.body.appendChild(proxy)
invalidation.then(()=> proxy.remove())

await new Promise((resolve, reject) => {
proxy.contentWindow.__x_resolve = resolve;
proxy.contentWindow.self = {};
proxy.contentWindow.document.write(`
<script src="https://cdn.jsdelivr.net/npm/@xenova/transformers/dist/transformers.min.js"></script>
<script>
window.__x_resolve();
</script>
`);
});

return proxy.contentWindow.self;
}
Insert cell
{
return;
const pipeline = await transformers.pipeline('text-generation', 'distilgpt2');

return await pipeline('The capital of France is');
}
Insert cell
pipeline = await transformers.pipeline('text-generation', 'distilgpt2');
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more