{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# TIRAL 2: GPT-J\n", "\n", "Link: https://huggingface.co/course/chapter9/5?fw=pt\n", "\n", "Lastest Update Date: Apr. 2, 2023\n", "\n", "## Loading models from the Hugging Face Hub" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# IMPORTS\n", "\n", "import gradio as gr" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/zhilinzhou/anaconda3/lib/python3.10/site-packages/gradio/interface.py:93: UserWarning: gr.Intrerface.load() will be deprecated. Use gr.load() instead.\n", " warnings.warn(\"gr.Intrerface.load() will be deprecated. Use gr.load() instead.\")\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Fetching model from: https://huggingface.co/EleutherAI/gpt-j-6B\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/Users/zhilinzhou/anaconda3/lib/python3.10/site-packages/gradio/deprecation.py:40: UserWarning: `enable_queue` is deprecated in `Interface()`, please use it within `launch()` instead.\n", " warnings.warn(value)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Running on local URL: http://127.0.0.1:7861\n", "\n", "To create a public link, set `share=True` in `launch()`.\n" ] }, { "data": { "text/html": [ "
" ], "text/plain": [ "GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model
\"\n", "examples = [\n", " [\"The tower is 324 metres (1,063 ft) tall,\"],\n", " [\"The Moon's orbit around Earth has\"],\n", " [\"The smooth Borealis basin in the Northern Hemisphere covers 40%\"],\n", "]\n", "gr.load(\n", " \"huggingface/EleutherAI/gpt-j-6B\",\n", " inputs=gr.Textbox(lines=5, label=\"Input Text\"),\n", " title=title,\n", " description=description,\n", " article=article,\n", " examples=examples,\n", " enable_queue=True,\n", ").launch()" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Loading from Hugging Face Spaces\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/zhilinzhou/anaconda3/lib/python3.10/site-packages/gradio/interface.py:93: UserWarning: gr.Intrerface.load() will be deprecated. Use gr.load() instead.\n", " warnings.warn(\"gr.Intrerface.load() will be deprecated. Use gr.load() instead.\")\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Fetching Space from: https://huggingface.co/spaces/abidlabs/remove-bg\n", "Loaded as API: https://abidlabs-remove-bg.hf.space ✔\n", "Running on local URL: http://127.0.0.1:7862\n", "\n", "To create a public link, set `share=True` in `launch()`.\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "