adt commited on
Commit
7c580ce
·
verified ·
1 Parent(s): 9b82ce0

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -19,13 +19,13 @@ table tr:nth-child(even) { background: #f5f5f5 !important; }
19
  table tr:hover { background: #e8e8f0 !important; }
20
  """
21
 
22
- CLIP_LENGTH = 80
23
 
24
  df = pd.read_csv("models-table-free.csv", dtype=str, keep_default_na=False)
25
 
26
- for col in ["Notes", "Training dataset", "Tags", "Lab"]:
27
  if col in df.columns:
28
- df[col] = df[col].apply(lambda x: x[:CLIP_LENGTH] + "..." if len(x) > CLIP_LENGTH else x)
29
 
30
  with gr.Blocks(title="Models Table Pro — Free Preview", css=CSS) as demo:
31
  gr.Markdown(DESCRIPTION)
 
19
  table tr:hover { background: #e8e8f0 !important; }
20
  """
21
 
22
+ CLIP = {"Lab": 25, "Notes": 80, "Training dataset": 80, "Tags": 80}
23
 
24
  df = pd.read_csv("models-table-free.csv", dtype=str, keep_default_na=False)
25
 
26
+ for col, maxlen in CLIP.items():
27
  if col in df.columns:
28
+ df[col] = df[col].apply(lambda x: x[:maxlen] + "..." if len(x) > maxlen else x)
29
 
30
  with gr.Blocks(title="Models Table Pro — Free Preview", css=CSS) as demo:
31
  gr.Markdown(DESCRIPTION)