hysts HF Staff commited on
Commit
3c54e5c
·
1 Parent(s): 76584e4
Files changed (1) hide show
  1. app.py +24 -1
app.py CHANGED
@@ -1,9 +1,32 @@
1
  #!/usr/bin/env python
2
 
3
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  with gr.Blocks() as demo:
6
- pass
 
 
 
 
7
 
8
  if __name__ == "__main__":
9
  demo.queue().launch()
 
1
  #!/usr/bin/env python
2
 
3
  import gradio as gr
4
+ import pandas as pd
5
+
6
+ df = pd.DataFrame(
7
+ data={
8
+ "col": [
9
+ """
10
+ Single newline:
11
+ Message continues here
12
+ """,
13
+ """
14
+ Double newline:
15
+
16
+ Message continues here
17
+ """,
18
+ "Single newline:\nMessage continues here",
19
+ "Double newline:\n\nMessage continues here",
20
+ ],
21
+ }
22
+ )
23
 
24
  with gr.Blocks() as demo:
25
+ with gr.Row():
26
+ with gr.Column():
27
+ gr.Dataframe(value=df, datatype="markdown", line_breaks=False)
28
+ with gr.Column():
29
+ gr.Dataframe(value=df, datatype="markdown", line_breaks=True)
30
 
31
  if __name__ == "__main__":
32
  demo.queue().launch()