gradio/js/lite/index2.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1010 B
HTML
Raw Normal View History

Extend Interface.from_pipeline() to support Transformers.js.py pipelines on Lite (#8052) * Extend Interface.from_pipeline() to support Transformers.js.py pipelines on Lite (wip: only object-detection in this commit) * add changeset * Add image-classification and image-segmentation * Add zero-shot-image-classification and zero-shot-object-detection * Add document-question-answering * Add feature-extraction and fill-mask * Add question-answering and summarization * Fix an error message * Add text2text-generation, text-classification, and text-generation * Add translation andtranslation_xx_to_yy * Add zero-shot-classification * Add postprocess_takes_inputs to control the args passed to the postprocess function of each pipeline * Add topk option to image-classification * format_backend * Add audio-classification, automatic-speech-recognition, and zero-shot-audio-classification * Add image-to-text * Add token-classification (with JSON component as an output. Is it correct?) * Ignore import type failure of transformers_js_py * Add image-feature-extraction * Add image-to-image * Add text-to-audio * Add depth-estimation * Remove `render=False` * Reorder the if-blocks following the Transformers.js doc * Update gradio/pipelines_utils.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/pipelines_utils.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Fix feature-extraction demo * Fix demo title * Add guides/08_gradio-clients-and-lite/gradio-lite-and-transformers-js.md without contents * Rename guides/08_gradio-clients-and-lite/*.md to fix the order * Use pipeline.model.config._name_or_path for the demo title instead of pipeline.model.config.model_type * Fix normal Interface.from_pipeline to use pipeline.model.config.name_or_path as the demo title * Write an article about Gradio-Lite and Transformers.js * Update the doc * tweaks * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2024-05-03 15:37:51 +08:00
<!doctype html>
<!-- A demo HTML file to test the bundled JS and CSS files -->
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin="anonymous"
/>
<script type="module" crossorigin src="./dist/lite.js"></script>
<link rel="stylesheet" href="./dist/lite.css" />
</head>
<body style="padding: 10px; height: 100%; width: 100%">
<h1>Lorem Ipsum Dolor</h1>
<gradio-lite>
<gradio-requirements> transformers_js_py[audio] </gradio-requirements>
<gradio-file name="app.py" entrypoint>
import gradio as gr from transformers_js_py import pipeline pipe = await
pipeline('automatic-speech-recognition'); demo =
gr.Interface.from_pipeline(pipe) if __name__ == "__main__":
demo.launch()
</gradio-file>
</gradio-lite>
</body>
</html>