Adding per model pages
Browse files- app.py +13 -4
- static/figures/Mistral-7B-Instruct-v0.1/ranks.svg +0 -0
- static/figures/Mistral-7B-Instruct-v0.1/structure.svg +0 -0
- static/figures/Mistral-7B-Instruct-v0.2/ranks.svg +0 -0
- static/figures/Mistral-7B-Instruct-v0.2/structure.svg +0 -0
- static/figures/Mistral-7B-Instruct-v0.3/ranks.svg +0 -0
- static/figures/Mistral-7B-Instruct-v0.3/structure.svg +0 -0
- static/figures/Mixtral-8x22B-Instruct-v0.1/ranks.svg +0 -0
- static/figures/Mixtral-8x22B-Instruct-v0.1/structure.svg +0 -0
- static/figures/Mixtral-8x7B-Instruct-v0.1/ranks.svg +0 -0
- static/figures/Mixtral-8x7B-Instruct-v0.1/structure.svg +0 -0
- static/figures/Qwen2-72B-Instruct/ranks.svg +0 -0
- static/figures/Qwen2-72B-Instruct/structure.svg +0 -0
- static/figures/Qwen2-7B-Instruct/ranks.svg +0 -0
- static/figures/Qwen2-7B-Instruct/structure.svg +0 -0
- static/figures/command_r_plus/ranks.svg +0 -0
- static/figures/command_r_plus/structure.svg +0 -0
- static/figures/gpt-3.5-turbo-0125/ranks.svg +0 -0
- static/figures/gpt-3.5-turbo-0125/structure.svg +0 -0
- static/figures/gpt-4o-0513/ranks.svg +0 -0
- static/figures/gpt-4o-0513/structure.svg +0 -0
- static/figures/llama_3_70b_instruct/ranks.svg +0 -0
- static/figures/llama_3_70b_instruct/structure.svg +0 -0
- static/figures/llama_3_8b_instruct/ranks.svg +0 -0
- static/figures/llama_3_8b_instruct/structure.svg +0 -0
- static/figures/phi-3-medium-128k-instruct/ranks.svg +0 -0
- static/figures/phi-3-medium-128k-instruct/structure.svg +0 -0
- static/figures/phi-3-mini-128k-instruct/ranks.svg +0 -0
- static/figures/phi-3-mini-128k-instruct/structure.svg +0 -0
- leaderboard.csv → static/leaderboard.csv +0 -0
- templates/model_detail.html +107 -0
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from flask import Flask, render_template
|
2 |
import pandas as pd
|
3 |
|
4 |
app = Flask(__name__)
|
@@ -6,16 +6,25 @@ app = Flask(__name__)
|
|
6 |
@app.route('/')
|
7 |
def index():
|
8 |
# Load the CSV file into a DataFrame
|
9 |
-
df = pd.read_csv('leaderboard.csv')
|
10 |
|
11 |
df = df.round(3)
|
12 |
df.insert(0, '#', '')
|
13 |
|
14 |
-
#
|
15 |
-
table_html = df.to_html(classes='table table-striped table-bordered', index=False)
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
# Render the template with the table HTML
|
18 |
return render_template('index.html', table_html=table_html)
|
19 |
|
|
|
|
|
|
|
|
|
20 |
if __name__ == '__main__':
|
21 |
app.run(host='0.0.0.0', port=7860, debug=True)
|
|
|
1 |
+
from flask import Flask, render_template, url_for
|
2 |
import pandas as pd
|
3 |
|
4 |
app = Flask(__name__)
|
|
|
6 |
@app.route('/')
|
7 |
def index():
|
8 |
# Load the CSV file into a DataFrame
|
9 |
+
df = pd.read_csv('static/leaderboard.csv')
|
10 |
|
11 |
df = df.round(3)
|
12 |
df.insert(0, '#', '')
|
13 |
|
14 |
+
# Generate the table HTML with clickable model names
|
15 |
+
table_html = df.to_html(classes='table table-striped table-bordered', escape=False, index=False)
|
16 |
+
|
17 |
+
# Modify the table HTML to add links to model names
|
18 |
+
for model in df['Model']:
|
19 |
+
model_link = f'<a href="{url_for("model_detail", model_name=model)}">{model}</a>'
|
20 |
+
table_html = table_html.replace(f'>{model}<', f'>{model_link}<')
|
21 |
|
22 |
# Render the template with the table HTML
|
23 |
return render_template('index.html', table_html=table_html)
|
24 |
|
25 |
+
@app.route('/model/<model_name>')
|
26 |
+
def model_detail(model_name):
|
27 |
+
return render_template('model_detail.html', model_name=model_name)
|
28 |
+
|
29 |
if __name__ == '__main__':
|
30 |
app.run(host='0.0.0.0', port=7860, debug=True)
|
static/figures/Mistral-7B-Instruct-v0.1/ranks.svg
ADDED
static/figures/Mistral-7B-Instruct-v0.1/structure.svg
ADDED
static/figures/Mistral-7B-Instruct-v0.2/ranks.svg
ADDED
static/figures/Mistral-7B-Instruct-v0.2/structure.svg
ADDED
static/figures/Mistral-7B-Instruct-v0.3/ranks.svg
ADDED
static/figures/Mistral-7B-Instruct-v0.3/structure.svg
ADDED
static/figures/Mixtral-8x22B-Instruct-v0.1/ranks.svg
ADDED
static/figures/Mixtral-8x22B-Instruct-v0.1/structure.svg
ADDED
static/figures/Mixtral-8x7B-Instruct-v0.1/ranks.svg
ADDED
static/figures/Mixtral-8x7B-Instruct-v0.1/structure.svg
ADDED
static/figures/Qwen2-72B-Instruct/ranks.svg
ADDED
static/figures/Qwen2-72B-Instruct/structure.svg
ADDED
static/figures/Qwen2-7B-Instruct/ranks.svg
ADDED
static/figures/Qwen2-7B-Instruct/structure.svg
ADDED
static/figures/command_r_plus/ranks.svg
ADDED
static/figures/command_r_plus/structure.svg
ADDED
static/figures/gpt-3.5-turbo-0125/ranks.svg
ADDED
static/figures/gpt-3.5-turbo-0125/structure.svg
ADDED
static/figures/gpt-4o-0513/ranks.svg
ADDED
static/figures/gpt-4o-0513/structure.svg
ADDED
static/figures/llama_3_70b_instruct/ranks.svg
ADDED
static/figures/llama_3_70b_instruct/structure.svg
ADDED
static/figures/llama_3_8b_instruct/ranks.svg
ADDED
static/figures/llama_3_8b_instruct/structure.svg
ADDED
static/figures/phi-3-medium-128k-instruct/ranks.svg
ADDED
static/figures/phi-3-medium-128k-instruct/structure.svg
ADDED
static/figures/phi-3-mini-128k-instruct/ranks.svg
ADDED
static/figures/phi-3-mini-128k-instruct/structure.svg
ADDED
leaderboard.csv → static/leaderboard.csv
RENAMED
File without changes
|
templates/model_detail.html
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>{{ model_name }}</title>
|
7 |
+
<!-- Include Bootstrap CSS for styling -->
|
8 |
+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.1.3/css/bootstrap.min.css">
|
9 |
+
<!-- Custom CSS for additional styling -->
|
10 |
+
<style>
|
11 |
+
body {
|
12 |
+
background-color: #f8f9fa;
|
13 |
+
font-family: 'Arial', sans-serif;
|
14 |
+
}
|
15 |
+
.container {
|
16 |
+
max-width: 1200px; /* Limit the width of the container */
|
17 |
+
margin: auto; /* Center the container */
|
18 |
+
padding: 20px; /* Add some padding */
|
19 |
+
background: #fff;
|
20 |
+
border-radius: 8px;
|
21 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
22 |
+
}
|
23 |
+
h1 {
|
24 |
+
color: #333;
|
25 |
+
text-align: center;
|
26 |
+
}
|
27 |
+
.model-name {
|
28 |
+
font-size: 24px;
|
29 |
+
font-weight: bold;
|
30 |
+
text-align: center;
|
31 |
+
margin-top: 40px;
|
32 |
+
margin-bottom: 40px;
|
33 |
+
padding: 20px; /* Add padding for more margin around text */
|
34 |
+
background-color: #610b5d;
|
35 |
+
color: #fff; /* Ensure text is readable on dark background */
|
36 |
+
border-radius: 15px; /* Rounded edges */
|
37 |
+
}
|
38 |
+
.back-button {
|
39 |
+
text-align: center;
|
40 |
+
margin-top: 20px;
|
41 |
+
}
|
42 |
+
.image-section {
|
43 |
+
text-align: center;
|
44 |
+
margin-top: 40px;
|
45 |
+
}
|
46 |
+
.image-section h2 {
|
47 |
+
font-size: 30px;
|
48 |
+
margin-bottom: 20px;
|
49 |
+
}
|
50 |
+
.image-container {
|
51 |
+
width: 100%;
|
52 |
+
margin-bottom: 40px;
|
53 |
+
}
|
54 |
+
.image-container img {
|
55 |
+
max-width: 100%;
|
56 |
+
height: auto;
|
57 |
+
display: block;
|
58 |
+
margin: auto;
|
59 |
+
border: 1px solid #dee2e6;
|
60 |
+
border-radius: 8px;
|
61 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
62 |
+
}
|
63 |
+
.custom-button {
|
64 |
+
background-color: #610b5d;
|
65 |
+
color: #fff; /* Set white text color */
|
66 |
+
border-radius: 15px; /* Rounded edges */
|
67 |
+
padding: 10px 20px; /* Padding for the button */
|
68 |
+
font-size: 18px; /* Increase font size */
|
69 |
+
text-decoration: none; /* Remove underline */
|
70 |
+
}
|
71 |
+
.custom-button:hover {
|
72 |
+
background-color: #812b7d;
|
73 |
+
color: #fff;
|
74 |
+
}
|
75 |
+
</style>
|
76 |
+
</head>
|
77 |
+
<body>
|
78 |
+
<div class="container">
|
79 |
+
<h1 class="mt-5">Stick To Your Role! Leaderboard</h1>
|
80 |
+
<div class="model-name">{{ model_name }}</div>
|
81 |
+
<div class="image-section">
|
82 |
+
<h2>Structure</h2>
|
83 |
+
<p>This image shows .....</p>
|
84 |
+
<div class="image-container">
|
85 |
+
<a href="{{ url_for('static', filename='figures/' + model_name + '/structure.svg') }}" target="_blank">
|
86 |
+
<img src="{{ url_for('static', filename='figures/' + model_name + '/structure.svg') }}" alt="Structure">
|
87 |
+
</a>
|
88 |
+
</div>
|
89 |
+
</div>
|
90 |
+
<div class="image-section">
|
91 |
+
<h2>Ranks</h2>
|
92 |
+
<p>This image shows .....</p>
|
93 |
+
<div class="image-container">
|
94 |
+
<a href="{{ url_for('static', filename='figures/' + model_name + '/ranks.svg') }}" target="_blank">
|
95 |
+
<img src="{{ url_for('static', filename='figures/' + model_name + '/ranks.svg') }}" alt="Ranks">
|
96 |
+
</a>
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
<div class="back-button">
|
100 |
+
<a href="{{ url_for('index') }}" class="custom-button mt-3">Back</a>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
|
104 |
+
<!-- Include Bootstrap JS -->
|
105 |
+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
|
106 |
+
</body>
|
107 |
+
</html>
|