yonatanbitton commited on
Commit
cea42fe
·
1 Parent(s): 5fa6c95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -21,6 +21,9 @@ df = df.sample(frac=1)
21
 
22
  df['image'] = df['image_url'].apply(lambda x: '<a href= "' + str(x) + '" target="_blank"> <img src= "' + str(
23
  x) + '"/> </a>')
 
 
 
24
 
25
  LINES_NUMBER = 20
26
 
@@ -54,7 +57,10 @@ with gr.Blocks() as demo:
54
 
55
  with gr.Row():
56
  out_dataframe = gr.Dataframe(initial_dataframe, wrap=True, max_rows=LINES_NUMBER, overflow_row_behaviour="paginate",
57
- interactive=False)
 
 
 
58
 
59
  b1.click(fn=display_df, outputs=out_dataframe, api_name="initial_dataframe")
60
  b2.click(fn=display_next, inputs=[out_dataframe, num_end], outputs=[out_dataframe, num_end],
 
21
 
22
  df['image'] = df['image_url'].apply(lambda x: '<a href= "' + str(x) + '" target="_blank"> <img src= "' + str(
23
  x) + '"/> </a>')
24
+ cols = list(df.columns)
25
+ cols.insert(0, cols.pop(cols.index('image')))
26
+ df = df.reindex(columns=cols)
27
 
28
  LINES_NUMBER = 20
29
 
 
57
 
58
  with gr.Row():
59
  out_dataframe = gr.Dataframe(initial_dataframe, wrap=True, max_rows=LINES_NUMBER, overflow_row_behaviour="paginate",
60
+ interactive=False,
61
+ datatype=["markdown", "str", "str", "str", "bool",
62
+ "bool", "bool", "str", "str", "str"])
63
+
64
 
65
  b1.click(fn=display_df, outputs=out_dataframe, api_name="initial_dataframe")
66
  b2.click(fn=display_next, inputs=[out_dataframe, num_end], outputs=[out_dataframe, num_end],