Wauplin HF staff commited on
Commit
27f5f66
1 Parent(s): 7403ab9
Files changed (2) hide show
  1. app.py +6 -2
  2. open_pr.py +0 -1
app.py CHANGED
@@ -26,7 +26,7 @@ For more details about **Gradio Space CI**, checkout [this page]](https://huggin
26
  If you find any issues, please report here: https://huggingface.co/spaces/Wauplin/gradio-space-ci/discussions
27
  """
28
 
29
- gr.Interface(
30
  fn=open_pr,
31
  inputs=["text", "text"],
32
  outputs="markdown",
@@ -35,4 +35,8 @@ gr.Interface(
35
  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.",
36
  allow_flagging=False,
37
  allow_duplication=False,
38
- ).launch()
 
 
 
 
 
26
  If you find any issues, please report here: https://huggingface.co/spaces/Wauplin/gradio-space-ci/discussions
27
  """
28
 
29
+ interface = gr.Interface(
30
  fn=open_pr,
31
  inputs=["text", "text"],
32
  outputs="markdown",
 
35
  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.",
36
  allow_flagging=False,
37
  allow_duplication=False,
38
+ )
39
+
40
+ with gr.Blocks() as demo:
41
+ interface.render()
42
+ demo.launch()
open_pr.py CHANGED
@@ -87,7 +87,6 @@ def open_pr(space_id_or_url: str, token: str) -> str:
87
  if not api.file_exists(repo_id=space_id, repo_type="space", filename=app_file):
88
  raise gr.Error(f"Could not find app file '{app_file}' in Space repo.")
89
 
90
-
91
  # 3. Enable CI in app.py
92
  with open(api.hf_hub_download(repo_id=space_id, repo_type="space", filename=app_file)) as f:
93
  app = f.read()
 
87
  if not api.file_exists(repo_id=space_id, repo_type="space", filename=app_file):
88
  raise gr.Error(f"Could not find app file '{app_file}' in Space repo.")
89
 
 
90
  # 3. Enable CI in app.py
91
  with open(api.hf_hub_download(repo_id=space_id, repo_type="space", filename=app_file)) as f:
92
  app = f.read()