How do I get started using the Demos feature?

The Demos feature allows you to easily share your Gradio machine learning app (demo) both publicly and privately.

To get started using the Demos feature, you need to:

  1. Add a demo to your Lambda GPU Cloud account.
  2. Host your demo on a new instance.

Add a demo to your Lambda GPU Cloud account

  1. In the left sidebar of the dashboard, click Demos. Then, click the Add demo button at the top-right of the dashboard.

    The Add a demo dialog will appear.

  2. Under Demo Source URL, enter the URL of the Git repository containing your demo’s source code.

  3. Under Visibility, choose:

  4. Under Name, give your demo a name. If you choose to make your demo public, the name of your demo will appear in the Lambda library of public models. The name of your demo will also appear in your demo’s URL.

  5. (Optional) Under Description, enter a description for your demo.

    The description shows under the name of your demo in your library of demos. If your demo is public, the description also shows under the name of your demo in the Lambda library of public models.

  6. Click Add demo to save your demo to your Lambda GPU Cloud account.

Host your demo on a new instance

  1. In the Demos dashboard, find the row containing the demo you want to host, then click Host. Follow the prompts to launch a new instance.

    Your new instance will take several minutes to launch and for your demo to become accessible.

  2. Once your instance is launched and your demo is accessible, a link with your demo’s name will appear under the Demo column. Click the link to access your demo.

Troubleshooting demos

If you experience trouble accessing your demo, the Demos logs can be helpful for troubleshooting.

To view the Demos log files, SSH into your instance or open a terminal in Jupyter Notebook, then run:

sudo bash -c 'for f in /root/virt-sysprep-firstboot.log ~demo/bootstrap.log; do printf "### BEGIN $f\n\n"; cat $f; printf "\n### END $f\n\n"; done > demos_debug_logs.txt; printf "### BEGIN journalctl -u lambda-demos.service\n\n$(journalctl -u lambda-demos.service)\n\n### END journalctl -u lambda-demos.service" >> demos_debug_logs.txt'

This command will produce a file named demos_debug_logs.txt containing the logs for the Demos feature. You can review the logs from within your instance by running less demos_debug_logs.txt. Alternatively, you can download the file locally to review or share.

Here are some examples of how problems present in logs:

Misconfigured README.md file

### BEGIN /home/demo/bootstrap.log

Cloning into '/home/demo/source'...
Traceback (most recent call last):
  File "<stdin>", line 17, in <module>
  File "<stdin>", line 15, in load
  File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 3 validation errors for Metadata
sdk
  field required (type=value_error.missing)
sdk_version
  field required (type=value_error.missing)
app_file
  field required (type=value_error.missing)
Created symlink /etc/systemd/system/multi-user.target.wants/lambda-demos-error-server.service → /etc/systemd/system/lambda-demos-error-server.service.
Bootstrap failed: misconfigured

### END /home/demo/bootstrap.log

Not a Gradio app

### BEGIN /home/demo/bootstrap.log

Cloning into '/home/demo/source'...
Traceback (most recent call last):
  File "<stdin>", line 17, in <module>
  File "<stdin>", line 15, in load
  File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 2 validation errors for Metadata
sdk
  unexpected value; permitted: 'gradio' (type=value_error.const; given=docker; permitted=('gradio',))
sdk_version
  field required (type=value_error.missing)
Created symlink /etc/systemd/system/multi-user.target.wants/lambda-demos-error-server.service → /etc/systemd/system/lambda-demos-error-server.service.
Bootstrap failed: misconfigured

### END /home/demo/bootstrap.log