NimaBoscarino commited on
Commit
fe5361e
β€’
1 Parent(s): f62b8c4

Fix mobile bug with incorrect column layout

Browse files
Files changed (1) hide show
  1. app.py +18 -12
app.py CHANGED
@@ -50,10 +50,16 @@ def read_file(file_obj):
50
 
51
  model_card_box = gr.TextArea(label="Model Card")
52
 
 
 
 
 
 
 
 
 
 
53
  with gr.Blocks(css="""\
54
- #reverse-row {
55
- flex-direction: row-reverse;
56
- }
57
  #file-upload .boundedheight {
58
  max-height: 100px;
59
  }
@@ -79,15 +85,7 @@ code {
79
  Once your card is loaded, click "Run validation checks" to receive your results.
80
  """)
81
 
82
- with gr.Row(elem_id="reverse-row"):
83
- with gr.Column():
84
- submit_markdown = gr.Button(value="Run validation checks")
85
- with gr.Tab(label="Results"):
86
- with gr.Column():
87
- compliance_results = [compliance_result(c) for c in suite.checks]
88
- compliance_accordions = [c[0] for c in compliance_results]
89
- compliance_descriptions = [c[1] for c in compliance_results]
90
-
91
  with gr.Column():
92
  with gr.Tab(label="Load a card from the πŸ€— Hugging Face Hub"):
93
  model_id_search = gr.Text(label="Model ID")
@@ -116,6 +114,14 @@ code {
116
 
117
  model_card_box.render()
118
 
 
 
 
 
 
 
 
 
119
  submit_model_search.click(
120
  fn=lambda x: ModelCard.load(repo_id_or_path=x).content,
121
  inputs=[model_id_search],
 
50
 
51
  model_card_box = gr.TextArea(label="Model Card")
52
 
53
+ # Have to destructure everything since I need to delay rendering.
54
+ col = gr.Column()
55
+ submit_markdown = gr.Button(value="Run validation checks")
56
+ tab = gr.Tab(label="Results")
57
+ col2 = gr.Column()
58
+ compliance_results = [compliance_result(c) for c in suite.checks]
59
+ compliance_accordions = [c[0] for c in compliance_results]
60
+ compliance_descriptions = [c[1] for c in compliance_results]
61
+
62
  with gr.Blocks(css="""\
 
 
 
63
  #file-upload .boundedheight {
64
  max-height: 100px;
65
  }
 
85
  Once your card is loaded, click "Run validation checks" to receive your results.
86
  """)
87
 
88
+ with gr.Row():
 
 
 
 
 
 
 
 
89
  with gr.Column():
90
  with gr.Tab(label="Load a card from the πŸ€— Hugging Face Hub"):
91
  model_id_search = gr.Text(label="Model ID")
 
114
 
115
  model_card_box.render()
116
 
117
+ with col.render():
118
+ submit_markdown.render()
119
+ with tab.render():
120
+ with col2.render():
121
+ for a, d in compliance_results:
122
+ with a.render():
123
+ d.render()
124
+
125
  submit_model_search.click(
126
  fn=lambda x: ModelCard.load(repo_id_or_path=x).content,
127
  inputs=[model_id_search],