freddyaboulton HF staff commited on
Commit
9306329
1 Parent(s): c24bffd

Fix example formatting

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -62,7 +62,7 @@ A quick overview of the currently supported merge methods:
62
 
63
  """
64
 
65
- examples = [[f.name, f.read_text()] for f in pathlib.Path("examples").glob("*.yml")]
66
 
67
 
68
  def merge(
@@ -111,7 +111,8 @@ with gr.Blocks() as demo:
111
  )
112
  button = gr.Button("Merge", variant="primary")
113
  logs = LogsView()
114
- gr.Examples(examples, label="Examples", inputs=[filename, config], outputs=[logs])
 
115
  gr.Markdown(MARKDOWN_ARTICLE)
116
 
117
  button.click(fn=merge, inputs=[filename, config, token, repo_name], outputs=[logs])
 
62
 
63
  """
64
 
65
+ examples = [[str(f)] for f in pathlib.Path("examples").glob("*.yml")]
66
 
67
 
68
  def merge(
 
111
  )
112
  button = gr.Button("Merge", variant="primary")
113
  logs = LogsView()
114
+ gr.Examples(examples, fn=lambda s: (s,), run_on_click=True,
115
+ label="Examples", inputs=[filename], outputs=[config])
116
  gr.Markdown(MARKDOWN_ARTICLE)
117
 
118
  button.click(fn=merge, inputs=[filename, config, token, repo_name], outputs=[logs])