CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
huggingface

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: huggingface/notebooks
Path: blob/main/course/vi/chapter9/section5.ipynb
Views: 2549
Kernel: Unknown Kernel

Tích hợp với Hugging Face Hub

Install the Transformers, Datasets, and Evaluate libraries to run this notebook.

!pip install datasets evaluate transformers[sentencepiece] !pip install gradio
import gradio as gr title = "GPT-J-6B" description = "Gradio Demo for GPT-J 6B, a transformer model trained using Ben Wang's Mesh Transformer JAX. 'GPT-J' refers to the class of model, while '6B' represents the number of trainable parameters. To use it, simply add your text, or click one of the examples to load them. Read more at the links below." article = "<p style='text-align: center'><a href='https://github.com/kingoflolz/mesh-transformer-jax' target='_blank'>GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model</a></p>" examples = [ ["The tower is 324 metres (1,063 ft) tall,"], ["The Moon's orbit around Earth has"], ["The smooth Borealis basin in the Northern Hemisphere covers 40%"], ] gr.Interface.load( "huggingface/EleutherAI/gpt-j-6B", inputs=gr.Textbox(lines=5, label="Input Text"), title=title, description=description, article=article, examples=examples, enable_queue=True, ).launch()
gr.Interface.load("spaces/abidlabs/remove-bg").launch()
gr.Interface.load( "spaces/abidlabs/remove-bg", inputs="webcam", title="Remove your webcam background!" ).launch()