lewtun HF staff commited on
Commit
f842e59
1 Parent(s): bdd92c6

Remove index

Browse files
Files changed (1) hide show
  1. app.py +16 -5
app.py CHANGED
@@ -1,7 +1,6 @@
1
  import os
2
  from datetime import datetime
3
  from pathlib import Path
4
- from re import sub
5
 
6
  import numpy as np
7
  import pandas as pd
@@ -49,7 +48,6 @@ def format_submissions(submissions):
49
  # The following picks the latest submissions which adhere to the model card schema
50
  for submission in submissions:
51
  submission_id = submission["id"]
52
- print(submission_id)
53
  response = requests.get(
54
  f"http://huggingface.co/api/datasets/{submission_id}?full=true",
55
  headers=header,
@@ -99,6 +97,19 @@ To submit to RAFT, follow the instruction posted on [this page](https://github.c
99
  )
100
  submissions = download_submissions()
101
  df = format_submissions(submissions)
102
- st.table(df.style.set_precision(3).set_properties(**{"white-space": "pre-wrap", "text-align": "center"}))
103
- # hack to remove index column: https://github.com/streamlit/streamlit/issues/641
104
- # st.table(df.assign(hack="").set_index("hack"))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import os
2
  from datetime import datetime
3
  from pathlib import Path
 
4
 
5
  import numpy as np
6
  import pandas as pd
 
48
  # The following picks the latest submissions which adhere to the model card schema
49
  for submission in submissions:
50
  submission_id = submission["id"]
 
51
  response = requests.get(
52
  f"http://huggingface.co/api/datasets/{submission_id}?full=true",
53
  headers=header,
 
97
  )
98
  submissions = download_submissions()
99
  df = format_submissions(submissions)
100
+ styler = df.style.set_precision(3).set_properties(**{"white-space": "pre-wrap", "text-align": "center"})
101
+ # hack to remove index column: https://discuss.streamlit.io/t/questions-on-st-table/6878/3
102
+ st.markdown(
103
+ """
104
+ <style>
105
+ table td:nth-child(1) {
106
+ display: none
107
+ }
108
+ table th:nth-child(1) {
109
+ display: none
110
+ }
111
+ </style>
112
+ """,
113
+ unsafe_allow_html=True,
114
+ )
115
+ st.table(styler)