Spaces:
Running on Zero
Running on Zero
Download openmodellab/reporting/html_writer.py from ajaygovind/OpenModelLab: direct link, hf CLI and curl.
- Browser
- Download file 877 Bytes
-
https://huggingface.co/spaces/ajaygovind/OpenModelLab/resolve/main/openmodellab/reporting/html_writer.py
- Command line
-
hf download hf://spaces/ajaygovind/OpenModelLab/openmodellab/reporting/html_writer.py
-
curl -L -o html_writer.py https://huggingface.co/spaces/ajaygovind/OpenModelLab/resolve/main/openmodellab/reporting/html_writer.py
877 Bytes
| def save_html(results, filename): | |
| rows = "" | |
| for item in results: | |
| rows += f""" | |
| <tr> | |
| <td>{item['model']}</td> | |
| <td>{item['parameters']}</td> | |
| <td>{item['layers']}</td> | |
| <td>{item['hidden_size']}</td> | |
| <td>{item['latency_ms']}</td> | |
| <td>{item['throughput']}</td> | |
| </tr> | |
| """ | |
| html = f""" | |
| <html> | |
| <head> | |
| <title>OpenModelLab Comparison</title> | |
| </head> | |
| <body> | |
| <h1>OpenModelLab Model Comparison</h1> | |
| <table border="1"> | |
| <tr> | |
| <th>Model</th> | |
| <th>Parameters</th> | |
| <th>Layers</th> | |
| <th>Hidden Size</th> | |
| <th>Latency(ms)</th> | |
| <th>Throughput</th> | |
| </tr> | |
| {rows} | |
| </table> | |
| </body> | |
| </html> | |
| """ | |
| with open(filename, "w") as f: | |
| f.write(html) | |
| return filename | |