freemt commited on
Commit
0a6c516
·
1 Parent(s): 773517f
Files changed (1) hide show
  1. app.py +20 -3
app.py CHANGED
@@ -52,7 +52,24 @@ def fn(text1: str, text2: str) -> Union[List[Any], str]:
52
  vfunc = np.vectorize(round2)
53
 
54
  df = pd.DataFrame(res)
55
- _ = df.style.background_gradient().set_precision(2)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  # return pd.DataFrame(vfunc(res), dtype="object")
58
  # return pd.DataFrame(vfunc(res), dtype="object").to_html()
@@ -90,9 +107,9 @@ try:
90
  Dies ist ein Test
91
  """),
92
  ],
93
- out_df,
94
  # out_text,
95
- # "html",
96
  title="gradio-cmat",
97
  theme="grass",
98
  allow_flagging="never",
 
52
  vfunc = np.vectorize(round2)
53
 
54
  df = pd.DataFrame(res)
55
+ # _ = df.style.background_gradient().set_precision(1)
56
+ # _ = df.style.background_gradient().format(precision=1)
57
+
58
+ _ = df.style.set_properties(
59
+ **{
60
+ "font-size": "10pt",
61
+ "border-color": "black",
62
+ "border": "1px black solid !important"
63
+ }
64
+ # border-color="black",
65
+ ).set_table_styles([{
66
+ "selector": "", # noqs
67
+ "props": [("border", "2px black solid !important")]}] # noqs
68
+ ).format(
69
+ precision=2
70
+ )
71
+
72
+ _ = _.to_html()
73
 
74
  # return pd.DataFrame(vfunc(res), dtype="object")
75
  # return pd.DataFrame(vfunc(res), dtype="object").to_html()
 
107
  Dies ist ein Test
108
  """),
109
  ],
110
+ # out_df,
111
  # out_text,
112
+ "html", # gr.outputs.HTML(label=None)
113
  title="gradio-cmat",
114
  theme="grass",
115
  allow_flagging="never",