Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
removing chat_template
Browse files- app.py +2 -4
- backend/config.py +6 -7
- backend/submission_handler.py +0 -3
- frontend/submit.html +0 -29
app.py
CHANGED
|
@@ -150,8 +150,7 @@ async def handle_submission(
|
|
| 150 |
precision: str = Form(...),
|
| 151 |
revision: str = Form(...),
|
| 152 |
weight_type: str = Form(...),
|
| 153 |
-
base_model: str = Form(None)
|
| 154 |
-
chat_template: str = Form(...)
|
| 155 |
):
|
| 156 |
"""Handles form submission."""
|
| 157 |
try:
|
|
@@ -161,8 +160,7 @@ async def handle_submission(
|
|
| 161 |
revision=revision,
|
| 162 |
precision=precision,
|
| 163 |
weight_type=weight_type,
|
| 164 |
-
model_type=model_type
|
| 165 |
-
chat_template=chat_template
|
| 166 |
)
|
| 167 |
|
| 168 |
if result_msg.startswith("**Success**"):
|
|
|
|
| 150 |
precision: str = Form(...),
|
| 151 |
revision: str = Form(...),
|
| 152 |
weight_type: str = Form(...),
|
| 153 |
+
base_model: str = Form(None)
|
|
|
|
| 154 |
):
|
| 155 |
"""Handles form submission."""
|
| 156 |
try:
|
|
|
|
| 160 |
revision=revision,
|
| 161 |
precision=precision,
|
| 162 |
weight_type=weight_type,
|
| 163 |
+
model_type=model_type
|
|
|
|
| 164 |
)
|
| 165 |
|
| 166 |
if result_msg.startswith("**Success**"):
|
backend/config.py
CHANGED
|
@@ -19,9 +19,8 @@ TASKS: List[Tuple[str, str, str]] = [
|
|
| 19 |
("qimma-AraDiCE-Culture:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "AraDiCE-Culture"),
|
| 20 |
("qimma-ArabicMMLU:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "ArabicMMLU"),
|
| 21 |
("qimma-ArabCulture:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "ArabCulture"),
|
| 22 |
-
("qimma-SyntheticQA:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "SyntheticQA"),
|
| 23 |
("qimma-PalmX:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "PALMX"),
|
| 24 |
-
("qimma-
|
| 25 |
("qimma-AraTrust|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "AraTrust"),
|
| 26 |
("qimma-Mizan|0", "normalized_mc_prob_norm", "MizanQA"),
|
| 27 |
(
|
|
@@ -31,11 +30,11 @@ TASKS: List[Tuple[str, str, str]] = [
|
|
| 31 |
),
|
| 32 |
("qimma-ArablegalEval-QA|0", "BERTScore-F", "ArabLegalQA"),
|
| 33 |
("acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "qimma-GAT:_average|0", "GAT"),
|
| 34 |
-
("acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "
|
| 35 |
-
("
|
| 36 |
-
("
|
| 37 |
-
("
|
| 38 |
-
("
|
| 39 |
]
|
| 40 |
|
| 41 |
# --- 3. Model Metadata ---
|
|
|
|
| 19 |
("qimma-AraDiCE-Culture:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "AraDiCE-Culture"),
|
| 20 |
("qimma-ArabicMMLU:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "ArabicMMLU"),
|
| 21 |
("qimma-ArabCulture:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "ArabCulture"),
|
|
|
|
| 22 |
("qimma-PalmX:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "PALMX"),
|
| 23 |
+
("qimma-3lmSTEM:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "3lmSTEM"),
|
| 24 |
("qimma-AraTrust|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "AraTrust"),
|
| 25 |
("qimma-Mizan|0", "normalized_mc_prob_norm", "MizanQA"),
|
| 26 |
(
|
|
|
|
| 30 |
),
|
| 31 |
("qimma-ArablegalEval-QA|0", "BERTScore-F", "ArabLegalQA"),
|
| 32 |
("acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "qimma-GAT:_average|0", "GAT"),
|
| 33 |
+
("qimma-GAT:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "GAT"),
|
| 34 |
+
("qimma-MedAraBench:_average|0", "acc:logprob_normalization=LogProbCharNorm(name='norm', ignore_first_space=False)", "MedAraBench"),
|
| 35 |
+
# ("humaneval", "humaneval+", "HumanEval+"),
|
| 36 |
+
# ("mbpp", "mbpp+", "MBPP+"),
|
| 37 |
+
# ("fann_or_flop", "fann_or_flop", "FannOrFlop"),
|
| 38 |
]
|
| 39 |
|
| 40 |
# --- 3. Model Metadata ---
|
backend/submission_handler.py
CHANGED
|
@@ -529,7 +529,6 @@ def submit_model(
|
|
| 529 |
precision: str = "",
|
| 530 |
weight_type: str = "",
|
| 531 |
model_type: str = "",
|
| 532 |
-
chat_template: str = "",
|
| 533 |
) -> str:
|
| 534 |
"""
|
| 535 |
Main controller: Validation -> Info Extraction -> Submission Upload.
|
|
@@ -605,7 +604,6 @@ def submit_model(
|
|
| 605 |
|
| 606 |
model_params = get_model_size(model_info=info, precision=precision)
|
| 607 |
current_time = datetime.utcnow().isoformat() + "Z"
|
| 608 |
-
is_chat = (chat_template.strip().lower() == "yes")
|
| 609 |
|
| 610 |
submission_data = {
|
| 611 |
"model": model_name,
|
|
@@ -622,7 +620,6 @@ def submit_model(
|
|
| 622 |
"private": model_private,
|
| 623 |
"job_id": None,
|
| 624 |
"job_start_time": None,
|
| 625 |
-
"chat_template": is_chat
|
| 626 |
}
|
| 627 |
|
| 628 |
# Define path in the requests dataset
|
|
|
|
| 529 |
precision: str = "",
|
| 530 |
weight_type: str = "",
|
| 531 |
model_type: str = "",
|
|
|
|
| 532 |
) -> str:
|
| 533 |
"""
|
| 534 |
Main controller: Validation -> Info Extraction -> Submission Upload.
|
|
|
|
| 604 |
|
| 605 |
model_params = get_model_size(model_info=info, precision=precision)
|
| 606 |
current_time = datetime.utcnow().isoformat() + "Z"
|
|
|
|
| 607 |
|
| 608 |
submission_data = {
|
| 609 |
"model": model_name,
|
|
|
|
| 620 |
"private": model_private,
|
| 621 |
"job_id": None,
|
| 622 |
"job_start_time": None,
|
|
|
|
| 623 |
}
|
| 624 |
|
| 625 |
# Define path in the requests dataset
|
frontend/submit.html
CHANGED
|
@@ -43,16 +43,6 @@
|
|
| 43 |
class="absolute right-3 top-3 h-4 w-4 text-slate-400 pointer-events-none"></i>
|
| 44 |
</div>
|
| 45 |
</div>
|
| 46 |
-
<div><label class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">Chat
|
| 47 |
-
Template?</label>
|
| 48 |
-
<div class="flex gap-4"><label class="flex items-center"><input type="radio"
|
| 49 |
-
name="chat_template" value="Yes" checked class="text-indigo-600 h-4 w-4"><span
|
| 50 |
-
class="ml-2 text-sm text-slate-600 dark:text-slate-400">Yes</span></label><label
|
| 51 |
-
class="flex items-center"><input type="radio" name="chat_template" value="No"
|
| 52 |
-
class="text-indigo-600 h-4 w-4"><span
|
| 53 |
-
class="ml-2 text-sm text-slate-600 dark:text-slate-400">No</span></label>
|
| 54 |
-
</div>
|
| 55 |
-
</div>
|
| 56 |
</div>
|
| 57 |
<div class="space-y-4">
|
| 58 |
<div><label
|
|
@@ -141,24 +131,6 @@
|
|
| 141 |
// 2. Handle Form Submission
|
| 142 |
const form = document.querySelector('#submitForm');
|
| 143 |
if (form) {
|
| 144 |
-
const modelTypeSelect = form.querySelector('select[name="model_type"]');
|
| 145 |
-
const chatYes = form.querySelector('input[name="chat_template"][value="Yes"]');
|
| 146 |
-
const chatNo = form.querySelector('input[name="chat_template"][value="No"]');
|
| 147 |
-
|
| 148 |
-
const syncChatTemplateDefault = () => {
|
| 149 |
-
if (!modelTypeSelect || !chatYes || !chatNo) return;
|
| 150 |
-
if (modelTypeSelect.value === 'pre-trained') {
|
| 151 |
-
chatNo.checked = true;
|
| 152 |
-
} else if (modelTypeSelect.value === 'finetuned') {
|
| 153 |
-
chatYes.checked = true;
|
| 154 |
-
}
|
| 155 |
-
};
|
| 156 |
-
|
| 157 |
-
if (modelTypeSelect) {
|
| 158 |
-
modelTypeSelect.addEventListener('change', syncChatTemplateDefault);
|
| 159 |
-
syncChatTemplateDefault();
|
| 160 |
-
}
|
| 161 |
-
|
| 162 |
form.onsubmit = async (e) => {
|
| 163 |
e.preventDefault();
|
| 164 |
const btn = document.querySelector('#submitBtn');
|
|
@@ -177,7 +149,6 @@
|
|
| 177 |
msg.className = "text-center text-sm font-medium text-emerald-600 dark:text-emerald-400";
|
| 178 |
msg.innerText = "✅ " + (json.message || "Success!");
|
| 179 |
e.target.reset();
|
| 180 |
-
syncChatTemplateDefault();
|
| 181 |
|
| 182 |
// Update Local Sidebar & Header
|
| 183 |
await updateSidebarQueue();
|
|
|
|
| 43 |
class="absolute right-3 top-3 h-4 w-4 text-slate-400 pointer-events-none"></i>
|
| 44 |
</div>
|
| 45 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
</div>
|
| 47 |
<div class="space-y-4">
|
| 48 |
<div><label
|
|
|
|
| 131 |
// 2. Handle Form Submission
|
| 132 |
const form = document.querySelector('#submitForm');
|
| 133 |
if (form) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
form.onsubmit = async (e) => {
|
| 135 |
e.preventDefault();
|
| 136 |
const btn = document.querySelector('#submitBtn');
|
|
|
|
| 149 |
msg.className = "text-center text-sm font-medium text-emerald-600 dark:text-emerald-400";
|
| 150 |
msg.innerText = "✅ " + (json.message || "Success!");
|
| 151 |
e.target.reset();
|
|
|
|
| 152 |
|
| 153 |
// Update Local Sidebar & Header
|
| 154 |
await updateSidebarQueue();
|