Abhishek Thakur
commited on
Commit
·
9b8659c
1
Parent(s):
ed00fce
new version
Browse files- competitions/app.py +72 -0
- competitions/cli/create.py +1 -1
- competitions/cli/run.py +1 -1
- competitions/competitions.py +2 -6
- competitions/templates/index.html +270 -0
- requirements.txt +7 -6
competitions/app.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
from fastapi import FastAPI, Request
|
| 4 |
+
from fastapi.responses import HTMLResponse, JSONResponse
|
| 5 |
+
from fastapi.staticfiles import StaticFiles
|
| 6 |
+
from fastapi.templating import Jinja2Templates
|
| 7 |
+
|
| 8 |
+
from competitions.info import CompetitionInfo
|
| 9 |
+
from competitions.leaderboard import Leaderboard
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
| 13 |
+
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 14 |
+
COMPETITION_ID = os.getenv("COMPETITION_ID")
|
| 15 |
+
COMP_INFO = CompetitionInfo(competition_id=COMPETITION_ID, autotrain_token=HF_TOKEN)
|
| 16 |
+
|
| 17 |
+
app = FastAPI()
|
| 18 |
+
static_path = os.path.join(BASE_DIR, "static")
|
| 19 |
+
app.mount("/static", StaticFiles(directory=static_path), name="static")
|
| 20 |
+
templates_path = os.path.join(BASE_DIR, "templates")
|
| 21 |
+
templates = Jinja2Templates(directory=templates_path)
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
@app.get("/", response_class=HTMLResponse)
|
| 25 |
+
async def read_form(request: Request):
|
| 26 |
+
"""
|
| 27 |
+
This function is used to render the HTML file
|
| 28 |
+
:param request:
|
| 29 |
+
:return:
|
| 30 |
+
"""
|
| 31 |
+
if HF_TOKEN is None:
|
| 32 |
+
return templates.TemplateResponse("error.html", {"request": request})
|
| 33 |
+
context = {"request": request}
|
| 34 |
+
return templates.TemplateResponse("index.html", context)
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
@app.get("/competition_info", response_class=JSONResponse)
|
| 38 |
+
async def get_comp_info(request: Request):
|
| 39 |
+
info = COMP_INFO.competition_desc
|
| 40 |
+
# info = markdown.markdown(info)
|
| 41 |
+
resp = {"response": info}
|
| 42 |
+
return resp
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
@app.get("/dataset_info", response_class=JSONResponse)
|
| 46 |
+
async def get_dataset_info(request: Request):
|
| 47 |
+
info = COMP_INFO.dataset_desc
|
| 48 |
+
# info = markdown.markdown(info)
|
| 49 |
+
resp = {"response": info}
|
| 50 |
+
return resp
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
@app.get("/leaderboard/{lb}", response_class=JSONResponse)
|
| 54 |
+
async def get_leaderboard(request: Request, lb: str):
|
| 55 |
+
leaderboard = Leaderboard(
|
| 56 |
+
end_date=COMP_INFO.end_date,
|
| 57 |
+
eval_higher_is_better=COMP_INFO.eval_higher_is_better,
|
| 58 |
+
max_selected_submissions=COMP_INFO.selection_limit,
|
| 59 |
+
competition_id=COMPETITION_ID,
|
| 60 |
+
autotrain_token=HF_TOKEN,
|
| 61 |
+
)
|
| 62 |
+
df = leaderboard.fetch(private=lb == "private")
|
| 63 |
+
resp = {"response": df.to_markdown(index=False)}
|
| 64 |
+
return resp
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
@app.get("/submissions", response_class=JSONResponse)
|
| 68 |
+
async def get_submissions(request: Request, user_token: str):
|
| 69 |
+
info = COMP_INFO.submission_desc
|
| 70 |
+
# info = markdown.markdown(info)
|
| 71 |
+
resp = {"response": info}
|
| 72 |
+
return resp
|
competitions/cli/create.py
CHANGED
|
@@ -16,4 +16,4 @@ class CreateCompetitionAppCommand(BaseCompetitionsCommand):
|
|
| 16 |
def run(self):
|
| 17 |
from ..create import demo
|
| 18 |
|
| 19 |
-
demo.queue(
|
|
|
|
| 16 |
def run(self):
|
| 17 |
from ..create import demo
|
| 18 |
|
| 19 |
+
demo.queue().launch()
|
competitions/cli/run.py
CHANGED
|
@@ -24,4 +24,4 @@ class RunCompetitionsAppCommand(BaseCompetitionsCommand):
|
|
| 24 |
def run(self):
|
| 25 |
from ..competitions import demo
|
| 26 |
|
| 27 |
-
demo.queue(
|
|
|
|
| 24 |
def run(self):
|
| 25 |
from ..competitions import demo
|
| 26 |
|
| 27 |
+
demo.queue().launch()
|
competitions/competitions.py
CHANGED
|
@@ -129,14 +129,10 @@ with gr.Blocks(css=".tabitem {padding: 25px}") as demo:
|
|
| 129 |
gr.Markdown(f"{competition_info.dataset_description}")
|
| 130 |
with gr.TabItem("Public Leaderboard", id="public_leaderboard") as public_leaderboard:
|
| 131 |
output_text_public = gr.Markdown()
|
| 132 |
-
output_df_public = gr.DataFrame(
|
| 133 |
-
row_count=(50, "dynamic"), overflow_row_behaviour="paginate", visible=False
|
| 134 |
-
)
|
| 135 |
with gr.TabItem("Private Leaderboard", id="private_leaderboard") as private_leaderboard:
|
| 136 |
output_text_private = gr.Markdown()
|
| 137 |
-
output_df_private = gr.DataFrame(
|
| 138 |
-
row_count=(50, "dynamic"), overflow_row_behaviour="paginate", visible=False
|
| 139 |
-
)
|
| 140 |
with gr.TabItem("New Submission", id="new_submission"):
|
| 141 |
if competition_info.submission_desc is None:
|
| 142 |
gr.Markdown(SUBMISSION_TEXT.format(competition_info.submission_limit))
|
|
|
|
| 129 |
gr.Markdown(f"{competition_info.dataset_description}")
|
| 130 |
with gr.TabItem("Public Leaderboard", id="public_leaderboard") as public_leaderboard:
|
| 131 |
output_text_public = gr.Markdown()
|
| 132 |
+
output_df_public = gr.DataFrame(row_count=(50, "dynamic"), visible=False)
|
|
|
|
|
|
|
| 133 |
with gr.TabItem("Private Leaderboard", id="private_leaderboard") as private_leaderboard:
|
| 134 |
output_text_private = gr.Markdown()
|
| 135 |
+
output_df_private = gr.DataFrame(row_count=(50, "dynamic"), visible=False)
|
|
|
|
|
|
|
| 136 |
with gr.TabItem("New Submission", id="new_submission"):
|
| 137 |
if competition_info.submission_desc is None:
|
| 138 |
gr.Markdown(SUBMISSION_TEXT.format(competition_info.submission_limit))
|
competitions/templates/index.html
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html>
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
| 8 |
+
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp"></script>
|
| 9 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
| 10 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.2.1/flowbite.min.css" rel="stylesheet" />
|
| 11 |
+
<script>
|
| 12 |
+
document.addEventListener('DOMContentLoaded', function () {
|
| 13 |
+
function showSubmissionModal() {
|
| 14 |
+
const modal = document.getElementById('submission-modal');
|
| 15 |
+
modal.classList.add('flex');
|
| 16 |
+
modal.classList.remove('hidden');
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
function hideSubmissionModal() {
|
| 20 |
+
const modal = document.getElementById('submission-modal');
|
| 21 |
+
modal.classList.remove('flex');
|
| 22 |
+
modal.classList.add('hidden');
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
function fetchAndDisplayCompetitionInfo() {
|
| 26 |
+
fetch('/competition_info')
|
| 27 |
+
.then(response => {
|
| 28 |
+
if (!response.ok) {
|
| 29 |
+
throw new Error('Network response was not ok');
|
| 30 |
+
}
|
| 31 |
+
return response.json(); // Parse the JSON response
|
| 32 |
+
})
|
| 33 |
+
.then(data => {
|
| 34 |
+
// Populate the 'content' div with the HTML from the response
|
| 35 |
+
const contentDiv = document.getElementById('content');
|
| 36 |
+
contentDiv.style.display = 'block';
|
| 37 |
+
contentDiv.innerHTML = marked.parse(data.response);
|
| 38 |
+
})
|
| 39 |
+
.catch(error => {
|
| 40 |
+
console.error('There has been a problem with your fetch operation:', error);
|
| 41 |
+
});
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
function fetchAndDisplayDatasetInfo() {
|
| 45 |
+
fetch('/dataset_info')
|
| 46 |
+
.then(response => {
|
| 47 |
+
if (!response.ok) {
|
| 48 |
+
throw new Error('Network response was not ok');
|
| 49 |
+
}
|
| 50 |
+
return response.json(); // Parse the JSON response
|
| 51 |
+
})
|
| 52 |
+
.then(data => {
|
| 53 |
+
// Populate the 'content' div with the HTML from the response
|
| 54 |
+
const contentDiv = document.getElementById('content');
|
| 55 |
+
contentDiv.innerHTML = marked.parse(data.response);
|
| 56 |
+
})
|
| 57 |
+
.catch(error => {
|
| 58 |
+
console.error('There has been a problem with your fetch operation:', error);
|
| 59 |
+
});
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
function fetchAndDisplayPublicLeaderboard() {
|
| 63 |
+
fetch('/leaderboard/public')
|
| 64 |
+
.then(response => {
|
| 65 |
+
if (!response.ok) {
|
| 66 |
+
throw new Error('Network response was not ok');
|
| 67 |
+
}
|
| 68 |
+
return response.json(); // Parse the JSON response
|
| 69 |
+
})
|
| 70 |
+
.then(data => {
|
| 71 |
+
// Populate the 'content' div with the HTML from the response
|
| 72 |
+
const contentDiv = document.getElementById('content');
|
| 73 |
+
contentDiv.innerHTML = marked.parse(data.response);
|
| 74 |
+
})
|
| 75 |
+
.catch(error => {
|
| 76 |
+
console.error('There has been a problem with your fetch operation:', error);
|
| 77 |
+
});
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
function fetchAndDisplayPrivateLeaderboard() {
|
| 81 |
+
fetch('/leaderboard/private')
|
| 82 |
+
.then(response => {
|
| 83 |
+
if (!response.ok) {
|
| 84 |
+
throw new Error('Network response was not ok');
|
| 85 |
+
}
|
| 86 |
+
return response.json(); // Parse the JSON response
|
| 87 |
+
})
|
| 88 |
+
.then(data => {
|
| 89 |
+
// Populate the 'content' div with the HTML from the response
|
| 90 |
+
const contentDiv = document.getElementById('content');
|
| 91 |
+
contentDiv.innerHTML = marked.parse(data.response);
|
| 92 |
+
})
|
| 93 |
+
.catch(error => {
|
| 94 |
+
console.error('There has been a problem with your fetch operation:', error);
|
| 95 |
+
});
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
// Find the 'Home' link in the sidebar
|
| 99 |
+
const homeLink = document.getElementById('home');
|
| 100 |
+
const datasetLink = document.getElementById('dataset');
|
| 101 |
+
const publicLBLink = document.getElementById('public_lb');
|
| 102 |
+
const privateLBLink = document.getElementById('private_lb');
|
| 103 |
+
const submissions = document.getElementById('submissions');
|
| 104 |
+
|
| 105 |
+
// Add a click event listener to the 'Home' link
|
| 106 |
+
homeLink.addEventListener('click', function (event) {
|
| 107 |
+
event.preventDefault(); // Prevent the default link behavior
|
| 108 |
+
fetchAndDisplayCompetitionInfo(); // Fetch and display info on click
|
| 109 |
+
});
|
| 110 |
+
|
| 111 |
+
datasetLink.addEventListener('click', function (event) {
|
| 112 |
+
event.preventDefault(); // Prevent the default link behavior
|
| 113 |
+
fetchAndDisplayDatasetInfo(); // Fetch and display info on click
|
| 114 |
+
});
|
| 115 |
+
|
| 116 |
+
publicLBLink.addEventListener('click', function (event) {
|
| 117 |
+
event.preventDefault(); // Prevent the default link behavior
|
| 118 |
+
fetchAndDisplayPublicLeaderboard(); // Fetch and display info on click
|
| 119 |
+
});
|
| 120 |
+
|
| 121 |
+
privateLBLink.addEventListener('click', function (event) {
|
| 122 |
+
event.preventDefault(); // Prevent the default link behavior
|
| 123 |
+
fetchAndDisplayPrivateLeaderboard(); // Fetch and display info on click
|
| 124 |
+
});
|
| 125 |
+
|
| 126 |
+
submissions.addEventListener('click', function (event) {
|
| 127 |
+
event.preventDefault(); // Prevent the default link behavior
|
| 128 |
+
showSubmissionModal(); // Fetch and display info on click
|
| 129 |
+
});
|
| 130 |
+
|
| 131 |
+
// Fetch and display info when the page loads
|
| 132 |
+
fetchAndDisplayCompetitionInfo();
|
| 133 |
+
|
| 134 |
+
document.querySelector('#submission-modal .cancel').addEventListener('click', function () {
|
| 135 |
+
hideSubmissionModal();
|
| 136 |
+
});
|
| 137 |
+
});
|
| 138 |
+
|
| 139 |
+
</script>
|
| 140 |
+
</head>
|
| 141 |
+
|
| 142 |
+
<body class="flex h-screen bg-gray-100">
|
| 143 |
+
<!-- Sidebar -->
|
| 144 |
+
<aside id="sidebar-multi-level-sidebar"
|
| 145 |
+
class="fixed top-0 left-0 z-40 w-64 h-screen transition-transform -translate-x-full sm:translate-x-0"
|
| 146 |
+
aria-label="Sidebar">
|
| 147 |
+
<div class="h-full px-3 py-4 overflow-y-auto bg-gray-50 dark:bg-gray-800">
|
| 148 |
+
<ul class="space-y-2 font-medium">
|
| 149 |
+
<li>
|
| 150 |
+
<a href="#" id="home"
|
| 151 |
+
class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
|
| 152 |
+
<svg class="w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white"
|
| 153 |
+
viewBox="0 0 22 21" xmlns="http://www.w3.org/2000/svg" fill="currentColor">
|
| 154 |
+
<path d="M1,10 L11,1 L21,10 L21,20 L1,20 Z" /> <!-- House structure -->
|
| 155 |
+
<path d="M6,20 L6,14 L16,14 L16,20" /> <!-- Door -->
|
| 156 |
+
</svg>
|
| 157 |
+
|
| 158 |
+
<span class="ms-3">Home</span>
|
| 159 |
+
</a>
|
| 160 |
+
</li>
|
| 161 |
+
<li>
|
| 162 |
+
<a href="#" id="dataset"
|
| 163 |
+
class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
|
| 164 |
+
<svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white"
|
| 165 |
+
aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor"
|
| 166 |
+
viewBox="0 0 18 18">
|
| 167 |
+
<path
|
| 168 |
+
d="M6.143 0H1.857A1.857 1.857 0 0 0 0 1.857v4.286C0 7.169.831 8 1.857 8h4.286A1.857 1.857 0 0 0 8 6.143V1.857A1.857 1.857 0 0 0 6.143 0Zm10 0h-4.286A1.857 1.857 0 0 0 10 1.857v4.286C10 7.169 10.831 8 11.857 8h4.286A1.857 1.857 0 0 0 18 6.143V1.857A1.857 1.857 0 0 0 16.143 0Zm-10 10H1.857A1.857 1.857 0 0 0 0 11.857v4.286C0 17.169.831 18 1.857 18h4.286A1.857 1.857 0 0 0 8 16.143v-4.286A1.857 1.857 0 0 0 6.143 10Zm10 0h-4.286A1.857 1.857 0 0 0 10 11.857v4.286c0 1.026.831 1.857 1.857 1.857h4.286A1.857 1.857 0 0 0 18 16.143v-4.286A1.857 1.857 0 0 0 16.143 10Z" />
|
| 169 |
+
</svg>
|
| 170 |
+
<span class="flex-1 ms-3 whitespace-nowrap">Dataset</span>
|
| 171 |
+
</a>
|
| 172 |
+
</li>
|
| 173 |
+
<li>
|
| 174 |
+
<button type="button"
|
| 175 |
+
class="flex items-center w-full p-2 text-base text-gray-900 transition duration-75 rounded-lg group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
|
| 176 |
+
aria-controls="dropdown-example" data-collapse-toggle="dropdown-example">
|
| 177 |
+
<svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-white"
|
| 178 |
+
aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor"
|
| 179 |
+
viewBox="0 0 18 21">
|
| 180 |
+
<path d="M2,4 L20,4 L20,16 L2,16 Z" />
|
| 181 |
+
<path d="M6,17 L16,17 L16,18 L6,18 Z" />
|
| 182 |
+
</svg>
|
| 183 |
+
<span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">Leaderboard</span>
|
| 184 |
+
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none"
|
| 185 |
+
viewBox="0 0 10 6">
|
| 186 |
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
| 187 |
+
d="m1 1 4 4 4-4" />
|
| 188 |
+
</svg>
|
| 189 |
+
</button>
|
| 190 |
+
<ul id="dropdown-example" class="hidden py-2 space-y-2">
|
| 191 |
+
<li>
|
| 192 |
+
<a href="#" id="public_lb"
|
| 193 |
+
class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Public</a>
|
| 194 |
+
</li>
|
| 195 |
+
<li>
|
| 196 |
+
<a href="#" id="private_lb"
|
| 197 |
+
class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Private</a>
|
| 198 |
+
</li>
|
| 199 |
+
</ul>
|
| 200 |
+
</li>
|
| 201 |
+
<li>
|
| 202 |
+
<a href="#"
|
| 203 |
+
class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
|
| 204 |
+
<svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white"
|
| 205 |
+
aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor"
|
| 206 |
+
viewBox="0 0 20 18">
|
| 207 |
+
<path
|
| 208 |
+
d="M14 2a3.963 3.963 0 0 0-1.4.267 6.439 6.439 0 0 1-1.331 6.638A4 4 0 1 0 14 2Zm1 9h-1.264A6.957 6.957 0 0 1 15 15v2a2.97 2.97 0 0 1-.184 1H19a1 1 0 0 0 1-1v-1a5.006 5.006 0 0 0-5-5ZM6.5 9a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9ZM8 10H5a5.006 5.006 0 0 0-5 5v2a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-2a5.006 5.006 0 0 0-5-5Z" />
|
| 209 |
+
</svg>
|
| 210 |
+
<span class="flex-1 ms-3 whitespace-nowrap">Team</span>
|
| 211 |
+
</a>
|
| 212 |
+
</li>
|
| 213 |
+
<li>
|
| 214 |
+
<a href="#" id="submissions"
|
| 215 |
+
class="flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group">
|
| 216 |
+
<svg class="flex-shrink-0 w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white"
|
| 217 |
+
aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor"
|
| 218 |
+
viewBox="0 0 20 20">
|
| 219 |
+
<path d="M5 5V.13a2.96 2.96 0 0 0-1.293.749L.879 3.707A2.96 2.96 0 0 0 .13 5H5Z" />
|
| 220 |
+
<path
|
| 221 |
+
d="M6.737 11.061a2.961 2.961 0 0 1 .81-1.515l6.117-6.116A4.839 4.839 0 0 1 16 2.141V2a1.97 1.97 0 0 0-1.933-2H7v5a2 2 0 0 1-2 2H0v11a1.969 1.969 0 0 0 1.933 2h12.134A1.97 1.97 0 0 0 16 18v-3.093l-1.546 1.546c-.413.413-.94.695-1.513.81l-3.4.679a2.947 2.947 0 0 1-1.85-.227 2.96 2.96 0 0 1-1.635-3.257l.681-3.397Z" />
|
| 222 |
+
<path
|
| 223 |
+
d="M8.961 16a.93.93 0 0 0 .189-.019l3.4-.679a.961.961 0 0 0 .49-.263l6.118-6.117a2.884 2.884 0 0 0-4.079-4.078l-6.117 6.117a.96.96 0 0 0-.263.491l-.679 3.4A.961.961 0 0 0 8.961 16Zm7.477-9.8a.958.958 0 0 1 .68-.281.961.961 0 0 1 .682 1.644l-.315.315-1.36-1.36.313-.318Zm-5.911 5.911 4.236-4.236 1.359 1.359-4.236 4.237-1.7.339.341-1.699Z" />
|
| 224 |
+
</svg>
|
| 225 |
+
<span class="flex-1 ms-3 whitespace-nowrap">Submissions</span>
|
| 226 |
+
</a>
|
| 227 |
+
</li>
|
| 228 |
+
<li>
|
| 229 |
+
<label for="project_name" class="text-xs font-medium text-white">Hugging Face Token (read-only)
|
| 230 |
+
</label>
|
| 231 |
+
<input type="password" name="user_token" id="user_token"
|
| 232 |
+
class="mt-1 block w-full border border-gray-300 px-3 py-1.5 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500">
|
| 233 |
+
</li>
|
| 234 |
+
</ul>
|
| 235 |
+
</div>
|
| 236 |
+
</aside>
|
| 237 |
+
<article class="prose p-4 sm:ml-64 max-w-5xl" id="content">
|
| 238 |
+
</article>
|
| 239 |
+
<div id="submission-modal" tabindex="-1"
|
| 240 |
+
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
| 241 |
+
<div class="form-container max-w-5xl mx-auto mt-3 p-6 shadow-2xl bg-white">
|
| 242 |
+
<form action="#" method="post" class="gap-2" enctype="multipart/form-data">
|
| 243 |
+
<div class="form-group">
|
| 244 |
+
<label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white" for="file_input">Upload
|
| 245 |
+
file</label>
|
| 246 |
+
<input
|
| 247 |
+
class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 focus:outline-none "
|
| 248 |
+
id="file_input" type="file">
|
| 249 |
+
</div>
|
| 250 |
+
<div class="form-group mt-2">
|
| 251 |
+
<label for="params" class="text-sm font-medium text-gray-700">Submission description (optional)
|
| 252 |
+
</label>
|
| 253 |
+
<textarea id="params" name="params" rows="5" class="p-2.5 w-full text-sm text-gray-900"
|
| 254 |
+
placeholder=""></textarea>
|
| 255 |
+
</div>
|
| 256 |
+
<div class="form-actions mt-6">
|
| 257 |
+
<button data-modal-hide="submission-modal" type="button"
|
| 258 |
+
class="confirm text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">
|
| 259 |
+
Submit
|
| 260 |
+
</button>
|
| 261 |
+
<button data-modal-hide="submission-modal" type="button"
|
| 262 |
+
class="cancel text-white bg-red-600 hover:bg-red-100 focus:ring-4 focus:outline-none focus:ring-red-200 rounded-lg border border-red-200 text-sm font-medium px-5 py-2.5 hover:text-red-900 focus:z-10">Cancel</button>
|
| 263 |
+
</div>
|
| 264 |
+
</form>
|
| 265 |
+
</div>
|
| 266 |
+
</div>
|
| 267 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.2.1/flowbite.min.js"></script>
|
| 268 |
+
</body>
|
| 269 |
+
|
| 270 |
+
</html>
|
requirements.txt
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
-
gradio==
|
| 2 |
-
joblib==1.2
|
| 3 |
-
loguru
|
| 4 |
-
pandas
|
| 5 |
-
huggingface_hub
|
| 6 |
-
tabulate==0.9.0
|
|
|
|
|
|
| 1 |
+
gradio==4.12.0
|
| 2 |
+
joblib==1.3.2
|
| 3 |
+
loguru==0.7.2
|
| 4 |
+
pandas==2.1.4
|
| 5 |
+
huggingface_hub==0.20.1
|
| 6 |
+
tabulate==0.9.0
|
| 7 |
+
markdown==3.5.1
|