fix: add template to code

This commit is contained in:
BuildTools 2024-09-23 21:49:37 -07:00
parent 9a94d5bbda
commit 1ce6d4c7d6
No known key found for this signature in database
GPG Key ID: 3270C066C15D530B
2 changed files with 83 additions and 0 deletions

6
.gitignore vendored
View File

@ -1,6 +1,9 @@
# Ignore everything
*
# Ignore .idea
/.idea
# Don't ignore directories, so we can recurse into them
!*/
@ -22,6 +25,9 @@
# Don't ignore Python files in src directory
!src/**/*.py
# Don't ignore templates
!templates/**/*.html
# Don't ignore requirements.txt in root
!requirements.txt

77
templates/index.html Normal file
View File

@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Model Metrics</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<meta name="apple-mobile-web-app-capable" content="yes">
<style>
body {
font-family: Arial, sans-serif;
background-color: #1e1e1e;
color: #ffffff;
margin: 0;
padding: 20px;
}
h1 {
color: #4CAF50;
}
select, button {
margin: 10px 0;
padding: 5px;
background-color: #333;
color: #fff;
border: 1px solid #555;
}
#plot {
width: 100%;
height: 800px;
}
pre {
background-color: #2a2a2a;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
}
.model-select {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 20px;
}
.model-select label {
display: flex;
align-items: center;
background-color: #333;
padding: 5px 10px;
border-radius: 5px;
}
.model-select input[type="checkbox"] {
margin-right: 5px;
}
</style>
</head>
<body>
<form method="POST">
<select name="model_select" onchange="this.form.submit()">
{% for model in model_names %}
<option value="{{ model }}" {% if model == model_name %}selected{% endif %}>{{ model }}</option>
{% endfor %}
</select>
</form>
{% if plot_div %}
{{ plot_div | safe }}
{% else %}
<p>No data available for the selected model.</p>
{% endif %}
{% if result %}
<h2>Token Statistics:</h2>
<pre>{{ result }}</pre>
{% endif %}
</body>
</html>