Omnibus commited on
Commit
6bcf23a
·
verified ·
1 Parent(s): 147693f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -1,18 +1,18 @@
1
  import gradio as gr
2
 
3
  mf={
4
- "Heading1":"#",
5
- "Heading2":"##",
6
- "Heading3":"###",
 
7
  }
8
-
9
  def upd(inp,format):
10
- line=f'{mf[format]} {inp}'
11
  return line
12
  with gr.Blocks() as app:
13
  format=gr.Dropdown(label="Line Format",choices=[m for m in list(mf.keys())])
14
  txt=gr.Textbox()
15
  btn=gr.Button()
16
- prev=gr.Markdown("# test")
17
  btn.click(upd,[txt,format],prev)
18
  app.launch()
 
1
  import gradio as gr
2
 
3
  mf={
4
+ "Heading1":"# $INP",
5
+ "Heading2":"## $INP",
6
+ "Heading3":"### $INP",
7
+ "Bold":"** $INP **"
8
  }
 
9
  def upd(inp,format):
10
+ line=f'{mf[format].replace("$INP",inp)}'
11
  return line
12
  with gr.Blocks() as app:
13
  format=gr.Dropdown(label="Line Format",choices=[m for m in list(mf.keys())])
14
  txt=gr.Textbox()
15
  btn=gr.Button()
16
+ prev=gr.Markdown("")
17
  btn.click(upd,[txt,format],prev)
18
  app.launch()