k-mktr commited on
Commit
dcde71a
Β·
verified Β·
1 Parent(s): baac06c

Update model_suggestions.py

Browse files
Files changed (1) hide show
  1. model_suggestions.py +21 -20
model_suggestions.py CHANGED
@@ -119,43 +119,47 @@ def get_suggestions_html() -> str:
119
  reverse=True
120
  )
121
 
122
- html = """
 
 
 
 
 
 
123
  <style>
124
- .suggestions-table {
125
  width: 100%;
126
  border-collapse: collapse;
127
  font-family: Arial, sans-serif;
128
  margin-top: 20px;
129
- }
130
- .suggestions-table th, .suggestions-table td {
131
  border: 1px solid #ddd;
132
  padding: 12px;
133
  text-align: left;
134
- }
135
- .suggestions-table th {
136
  background-color: rgba(255, 255, 255, 0.1);
137
  font-weight: bold;
138
- }
139
- .rank-column {
140
  width: 60px;
141
  text-align: center;
142
- }
143
- .count-badge {
144
  background-color: rgba(34, 87, 122, 0.7);
145
  color: white;
146
  padding: 4px 8px;
147
  border-radius: 12px;
148
  font-size: 0.9em;
149
- }
150
- .stats-header {
151
  font-size: 0.9em;
152
  color: #888;
153
  margin-bottom: 10px;
154
- }
155
  </style>
156
- <div class="stats-header">
157
- Total Suggestions: {total_suggestions} | Last Updated: {last_updated}
158
- </div>
159
  <table class='suggestions-table'>
160
  <tr>
161
  <th class='rank-column'>Rank</th>
@@ -164,10 +168,7 @@ def get_suggestions_html() -> str:
164
  <th>First Suggested</th>
165
  <th>Last Suggested</th>
166
  </tr>
167
- """.format(
168
- total_suggestions=suggestions.get("total_suggestions", 0),
169
- last_updated=suggestions.get("last_updated", "Never").split("T")[0]
170
- )
171
 
172
  for index, (model_url, data) in enumerate(sorted_suggestions, start=1):
173
  rank_display = {1: "πŸ₯‡", 2: "πŸ₯ˆ", 3: "πŸ₯‰"}.get(index, f"{index}")
 
119
  reverse=True
120
  )
121
 
122
+ stats_header = f"""
123
+ <div class="stats-header">
124
+ Total Suggestions: {suggestions.get("total_suggestions", 0)} | Last Updated: {suggestions.get("last_updated", "Never").split("T")[0]}
125
+ </div>
126
+ """
127
+
128
+ html = f"""
129
  <style>
130
+ .suggestions-table {{
131
  width: 100%;
132
  border-collapse: collapse;
133
  font-family: Arial, sans-serif;
134
  margin-top: 20px;
135
+ }}
136
+ .suggestions-table th, .suggestions-table td {{
137
  border: 1px solid #ddd;
138
  padding: 12px;
139
  text-align: left;
140
+ }}
141
+ .suggestions-table th {{
142
  background-color: rgba(255, 255, 255, 0.1);
143
  font-weight: bold;
144
+ }}
145
+ .rank-column {{
146
  width: 60px;
147
  text-align: center;
148
+ }}
149
+ .count-badge {{
150
  background-color: rgba(34, 87, 122, 0.7);
151
  color: white;
152
  padding: 4px 8px;
153
  border-radius: 12px;
154
  font-size: 0.9em;
155
+ }}
156
+ .stats-header {{
157
  font-size: 0.9em;
158
  color: #888;
159
  margin-bottom: 10px;
160
+ }}
161
  </style>
162
+ {stats_header}
 
 
163
  <table class='suggestions-table'>
164
  <tr>
165
  <th class='rank-column'>Rank</th>
 
168
  <th>First Suggested</th>
169
  <th>Last Suggested</th>
170
  </tr>
171
+ """
 
 
 
172
 
173
  for index, (model_url, data) in enumerate(sorted_suggestions, start=1):
174
  rank_display = {1: "πŸ₯‡", 2: "πŸ₯ˆ", 3: "πŸ₯‰"}.get(index, f"{index}")