Spaces:
Sleeping
Sleeping
SAGE OSS Evaluator
commited on
Commit
·
fa3ec7d
1
Parent(s):
1ac73b7
update
Browse files
app.py
CHANGED
|
@@ -254,22 +254,26 @@ with demo:
|
|
| 254 |
with gr.Accordion("📊 Submit Your SAGE Results", open=False):
|
| 255 |
gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")
|
| 256 |
|
| 257 |
-
#
|
| 258 |
gr.Markdown("""
|
| 259 |
### 📋 提交要求
|
|
|
|
| 260 |
- **登录要求**: 必须使用 HuggingFace 账号登录
|
| 261 |
-
- **账号限制**: 账号创建时间必须超过 60 天
|
| 262 |
- **提交频率**: 每个用户每天只能提交 1 次
|
|
|
|
| 263 |
- **文件格式**: 上传符合SAGE格式的JSON文件
|
| 264 |
- **组织信息**: 填写准确的组织名称(将显示在排行榜)
|
| 265 |
- **联系邮箱**: 提供有效邮箱用于结果通知
|
| 266 |
- **自动评测**: 提交后将自动进行LLM评测并更新排行榜
|
| 267 |
|
|
|
|
| 268 |
### 🔐 安全政策
|
| 269 |
为防止垃圾提交和确保评测质量,我们采用了严格的提交限制:
|
| 270 |
- 新账号需要等待60天才能提交(防止恶意注册)
|
| 271 |
- 每日提交限制确保排行榜质量和服务器稳定性
|
| 272 |
- 重复提交检查避免同一组织多次提交相同结果
|
|
|
|
| 273 |
""", elem_classes="markdown-text")
|
| 274 |
|
| 275 |
with gr.Row():
|
|
@@ -289,9 +293,9 @@ with demo:
|
|
| 289 |
type="filepath"
|
| 290 |
)
|
| 291 |
|
| 292 |
-
#
|
| 293 |
with gr.Row():
|
| 294 |
-
login_button = gr.LoginButton("🔐 Login with HuggingFace", size="lg")
|
| 295 |
submit_button = gr.Button("Submit Results", variant="primary", size="lg")
|
| 296 |
|
| 297 |
submission_result = gr.HTML()
|
|
@@ -311,33 +315,31 @@ with demo:
|
|
| 311 |
if "@" not in parsed_email:
|
| 312 |
return format_warning("请提供有效的邮箱地址")
|
| 313 |
|
| 314 |
-
# 3. 检查登录状态
|
| 315 |
-
if not profile:
|
| 316 |
-
|
| 317 |
|
| 318 |
-
# 4. 检查用户提交资格 (
|
| 319 |
-
eligible, message = check_user_submission_eligibility(profile, org_name)
|
| 320 |
-
if not eligible:
|
| 321 |
-
|
| 322 |
|
| 323 |
# 5. 处理文件提交 (通过OSS)
|
| 324 |
from src.submission.simple_submit import process_sage_submission_simple
|
| 325 |
result = process_sage_submission_simple(file_upload, org_name, email)
|
| 326 |
|
| 327 |
-
# 6. 记录用户提交历史
|
| 328 |
-
record_success = record_user_submission(profile, org_name, email)
|
| 329 |
-
if not record_success:
|
| 330 |
-
|
| 331 |
|
| 332 |
-
# 7. 添加成功提交的详细信息
|
| 333 |
success_info = f"""
|
| 334 |
<div style="background-color: #d4edda; border: 1px solid #c3e6cb; border-radius: 5px; padding: 15px; margin: 10px 0;">
|
| 335 |
<h4 style="color: #155724; margin-top: 0;">🎉 提交成功!</h4>
|
| 336 |
-
<p style="color: #155724; margin: 5px 0;"><strong>用户:</strong> {profile.username}</p>
|
| 337 |
<p style="color: #155724; margin: 5px 0;"><strong>组织:</strong> {org_name}</p>
|
| 338 |
<p style="color: #155724; margin: 5px 0;"><strong>邮箱:</strong> {email}</p>
|
| 339 |
<p style="color: #155724; margin: 5px 0;"><strong>提交时间:</strong> {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}</p>
|
| 340 |
-
<p style="color: #155724; margin: 5px 0;"><strong>下次可提交:</strong> 明天</p>
|
| 341 |
<p style="color: #155724; margin-bottom: 0;">您的结果已通过OSS提交,将在5-10分钟内完成LLM评测并更新排行榜。</p>
|
| 342 |
</div>
|
| 343 |
"""
|
|
|
|
| 254 |
with gr.Accordion("📊 Submit Your SAGE Results", open=False):
|
| 255 |
gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")
|
| 256 |
|
| 257 |
+
# 添加提交说明(登录要求暂时注释)
|
| 258 |
gr.Markdown("""
|
| 259 |
### 📋 提交要求
|
| 260 |
+
<!--
|
| 261 |
- **登录要求**: 必须使用 HuggingFace 账号登录
|
| 262 |
+
- **账号限制**: 账号创建时间必须超过 60 天
|
| 263 |
- **提交频率**: 每个用户每天只能提交 1 次
|
| 264 |
+
-->
|
| 265 |
- **文件格式**: 上传符合SAGE格式的JSON文件
|
| 266 |
- **组织信息**: 填写准确的组织名称(将显示在排行榜)
|
| 267 |
- **联系邮箱**: 提供有效邮箱用于结果通知
|
| 268 |
- **自动评测**: 提交后将自动进行LLM评测并更新排行榜
|
| 269 |
|
| 270 |
+
<!--
|
| 271 |
### 🔐 安全政策
|
| 272 |
为防止垃圾提交和确保评测质量,我们采用了严格的提交限制:
|
| 273 |
- 新账号需要等待60天才能提交(防止恶意注册)
|
| 274 |
- 每日提交限制确保排行榜质量和服务器稳定性
|
| 275 |
- 重复提交检查避免同一组织多次提交相同结果
|
| 276 |
+
-->
|
| 277 |
""", elem_classes="markdown-text")
|
| 278 |
|
| 279 |
with gr.Row():
|
|
|
|
| 293 |
type="filepath"
|
| 294 |
)
|
| 295 |
|
| 296 |
+
# 提交按钮 (登录功能暂时注释)
|
| 297 |
with gr.Row():
|
| 298 |
+
# login_button = gr.LoginButton("🔐 Login with HuggingFace", size="lg") # 暂时注释登录功能
|
| 299 |
submit_button = gr.Button("Submit Results", variant="primary", size="lg")
|
| 300 |
|
| 301 |
submission_result = gr.HTML()
|
|
|
|
| 315 |
if "@" not in parsed_email:
|
| 316 |
return format_warning("请提供有效的邮箱地址")
|
| 317 |
|
| 318 |
+
# 3. 检查登录状态 (暂时注释)
|
| 319 |
+
# if not profile:
|
| 320 |
+
# return format_error("请先登录 HuggingFace 账号后再提交")
|
| 321 |
|
| 322 |
+
# 4. 检查用户提交资格 (暂时注释登录相关检查)
|
| 323 |
+
# eligible, message = check_user_submission_eligibility(profile, org_name)
|
| 324 |
+
# if not eligible:
|
| 325 |
+
# return format_error(message)
|
| 326 |
|
| 327 |
# 5. 处理文件提交 (通过OSS)
|
| 328 |
from src.submission.simple_submit import process_sage_submission_simple
|
| 329 |
result = process_sage_submission_simple(file_upload, org_name, email)
|
| 330 |
|
| 331 |
+
# 6. 记录用户提交历史 (暂时注释)
|
| 332 |
+
# record_success = record_user_submission(profile, org_name, email)
|
| 333 |
+
# if not record_success:
|
| 334 |
+
# print(f"⚠️ 提交历史记录失败,但提交已成功处理")
|
| 335 |
|
| 336 |
+
# 7. 添加成功提交的详细信息 (移除用户相关信息)
|
| 337 |
success_info = f"""
|
| 338 |
<div style="background-color: #d4edda; border: 1px solid #c3e6cb; border-radius: 5px; padding: 15px; margin: 10px 0;">
|
| 339 |
<h4 style="color: #155724; margin-top: 0;">🎉 提交成功!</h4>
|
|
|
|
| 340 |
<p style="color: #155724; margin: 5px 0;"><strong>组织:</strong> {org_name}</p>
|
| 341 |
<p style="color: #155724; margin: 5px 0;"><strong>邮箱:</strong> {email}</p>
|
| 342 |
<p style="color: #155724; margin: 5px 0;"><strong>提交时间:</strong> {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}</p>
|
|
|
|
| 343 |
<p style="color: #155724; margin-bottom: 0;">您的结果已通过OSS提交,将在5-10分钟内完成LLM评测并更新排行榜。</p>
|
| 344 |
</div>
|
| 345 |
"""
|