Spaces:
Running
Running
File size: 1,594 Bytes
0fc235e ac36ca5 7403ab9 ac36ca5 0fc235e 7403ab9 0fc235e 27f5f66 7403ab9 713516b 7403ab9 27f5f66 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
#!/usr/bin/env python
import gradio as gr
from gradio_space_ci import enable_space_ci
from open_pr import open_pr
enable_space_ci()
DESCRIPTION = """
## Gradio Space CI is a tool to create ephemeral Spaces for each PR opened on your Space repo.
The goal is to improve developer experience by making the review process as lean as possible.
The app below let you open a PR to enable Space CI on a Space.
The steps are the following:
1. Paste a read-access token from hf.co/settings/tokens. Read access is enough given that we will open a PR against the source repo.
2. Input a Space id from the Hub
3. Click "Submit"
4. That's it! You'll get feedback if it works or not, and if it worked, you'll get the URL of the opened PR 🔥
#### ⚠️ Disclaimer: **Gradio Space CI** works only on public Spaces.
For more details about **Gradio Space CI**, checkout [this page]](https://huggingface.co/spaces/Wauplin/gradio-space-ci/blob/main/README.md).
If you find any issues, please report here: https://huggingface.co/spaces/Wauplin/gradio-space-ci/discussions
"""
interface = gr.Interface(
fn=open_pr,
inputs=["text", gr.LoginButton(), gr.LogoutButton()],
outputs="markdown",
title="Listen to Pull Requests and start ephemeral Spaces on new PRs! 🚀",
description=DESCRIPTION,
article="Provide a space ID and a token and click 'Submit'. A PR will be open to Space CI on the provided Space. You don't have to be the Space owner to open the PR.",
allow_flagging=False,
allow_duplication=False,
)
with gr.Blocks() as demo:
interface.render()
demo.launch()
|