Allen Park commited on
Commit
93e82e3
·
1 Parent(s): 8a56afd

add formatted svg code to gradio element in label parameter

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -48,6 +48,15 @@ body, .gradio-container {
48
  }
49
  """
50
 
 
 
 
 
 
 
 
 
 
51
  HEADER = """
52
  # Patronus Lynx Demo
53
  <table bgcolor="#1E2432" cellspacing="0" cellpadding="0" width="450">
@@ -157,7 +166,7 @@ with gr.Blocks(css=css) as demo:
157
  with gr.Column(scale=1):
158
  with gr.Row():
159
  question = gr.Textbox(label="Question", scale=4)
160
- u = gr.UploadButton("Upload question", file_count="single", scale=1)
161
  d = gr.DownloadButton("Download the file", visible=False, scale=1)
162
  with gr.Row():
163
  with gr.Column(scale=1):
 
48
  }
49
  """
50
 
51
+ formatted_upload_svg = '''
52
+ <div style="display: flex; align-items: center; justify-content: center;">
53
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
54
+ <path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5"/>
55
+ <path d="M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708z"/>
56
+ </svg>
57
+ </div>
58
+ '''
59
+
60
  HEADER = """
61
  # Patronus Lynx Demo
62
  <table bgcolor="#1E2432" cellspacing="0" cellpadding="0" width="450">
 
166
  with gr.Column(scale=1):
167
  with gr.Row():
168
  question = gr.Textbox(label="Question", scale=4)
169
+ u = gr.UploadButton(formatted_upload_svg, file_count="single", scale=1)
170
  d = gr.DownloadButton("Download the file", visible=False, scale=1)
171
  with gr.Row():
172
  with gr.Column(scale=1):