Skip to content

Commit

Permalink
one step back, one step forward
Browse files Browse the repository at this point in the history
  • Loading branch information
mdingemanse authored Apr 19, 2024
1 parent 3850a24 commit a91b080
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions scripts/consolidate_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ def write_simplified_html(df):
html_table = '<table>\n'
html_table += '<thead>\n'
html_table += '<tr class="main-header"><th>Project</th><th colspan="6">Availability</th><th colspan="6">Documentation</th><th colspan="2">Access</th></tr>\n'
html_table += '<tr class="second-header"><th>(maker, bases, URL)</th><th>Open code</th><th>LLM data</th><th>LLM weights</th><th>RL data</th><th>RL weights</th><th>License</th><th>Code</th><th>Architecture</th><th>Preprint</th><th>Paper</th><th>Modelcard</th><th>Datasheet</th><th>Package</th><th>API</th></tr>\n'
html_table += '<tr class="second-header"><th></th><th>Open code</th><th>LLM data</th><th>LLM weights</th><th>RL data</th><th>RL weights</th><th>License</th><th>Code</th><th>Architecture</th><th>Preprint</th><th>Paper</th><th>Modelcard</th><th>Datasheet</th><th>Package</th><th>API</th></tr>\n'
html_table += '</thead>\n'
html_table += '<tbody>\n'
# loop through projects
projects = df.index.tolist()
for p in projects:
# add data by looping through each data row and converting it to a row for the html table.
# add data by looping through each row and converting it 2 rows for the html table.
# also add classes to the <td> elements for colour coding and links to source of the class judgement: https://github.com/liesenf/awesome-open-chatgpt/issues/12
cells = ["opencode", "llmdata", "llmweights", "rldata", "rlweights", "license", "code", "architecture", "preprint", "paper", "modelcard", "datasheet", "package", "api"]
# first row
Expand All @@ -123,6 +123,13 @@ def write_simplified_html(df):
r1_html += '<td class="{} data-cell"><a target="_blank" href="{}" title="{}">{}</a></td>'.format(cl, link, notes, symbol)
r1_html += "</tr>\n"
html_table += r1_html
# second row
#r2_html = '<tr class="row-b"><td class="org"><a target="_blank" href="{}" title="{}">{}</a></td>'.format(df.loc[p, "org.link"], df.loc[p, "org.name"], df.loc[p, "org.name"])
r2_html = '<tr class="row-b"><td class="org"><a target="_blank" href="{}" title="{}">{}</a></td>'.format(df.loc[p, "project.link"], df.loc[p, "project.notes"], df.loc[p, "org.name"])
r2_html += '<td colspan="3" class="llmbase">LLM base: {}</td><td colspan="3" class="rlbase">RL base: {}</td>'.format(df.loc[p, "project.llmbase"], df.loc[p, "project.rlbase"])
#r2_html += '<td colspan="7"></td><td class="source-link"><a href="{}" title="{}" target="_blank">&sect;</a></td></tr>\n'.format(source_link, source_file)
r2_html += '<td colspan="7"></td><td class="source-link"><a href="{}" title="{}" target="_blank">&sect;</a></td></tr>\n'.format(df.loc[p, "org.link"], df.loc[p, "org.name"])
html_table += r2_html
# closing tags
html_table += '</tbody>\n'
html_table += '</table>\n'
Expand Down Expand Up @@ -174,6 +181,8 @@ def create_figure(figure):
# sort by openness and project name
df = df.sort_index(ascending=False).sort_values(by="openness", ascending=False)
table = write_html(df)
figure = write_simplified_html(df)
create_index(table)
figure = write_simplified_html(df)
create_figure(figure)

df.to_csv(df.csv, index=False)

0 comments on commit a91b080

Please sign in to comment.