Spaces:
Runtime error
Runtime error
fix about and submit
Browse filesFiles changed (4)
- .DS_Store
- app.py+47-58
- src/about.py+8-1
- src/display/utils.py+15-21
30 unmodified lines313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596972 unmodified lines10010110210310410510610710810911011111211311411530 unmodified linesdef submit_model_request(model_id: str, contact: str = "") -> str:"""Submit a model evaluation request"""if not model_id or not model_id.strip():return "❌ Please provide a model ID"model_id = model_id.strip()# Validate format (should have provider/model)if "/" not in model_id:return "❌ Model ID must include provider (e.g., `anthropic/claude-3-opus`)"provider, model_name = model_id.split("/", 1)# Check if already existsrequest_filename = f"{model_id.replace('/', '_')}_eval_request_False_float16_Original.json"# Create request objectrequest_data = {"model": model_id,"provider": provider,"base_model": "","revision": "main","precision": "float16","weight_type": "Original","status": "PENDING","submitted_time": datetime.now().isoformat() + "Z","submitted_by": contact if contact else "anonymous","model_type": "pretrained","likes": 0,"params": 0,"license": "?","private": False,}try:# Save to requests pathprovider_dir = os.path.join(EVAL_REQUESTS_PATH, provider)os.makedirs(provider_dir, exist_ok=True)request_path = os.path.join(provider_dir, request_filename)# Check if already existsif os.path.exists(request_path):with open(request_path, 'r') as f:existing = json.load(f)if existing.get("status") in ["FINISHED", "RUNNING"]:return f"❌ Model `{model_id}` is already {existing['status'].lower()}"# Write request filewith open(request_path, 'w') as f:json.dump(request_data, f, indent=2)# Try to push to HF (if token available)try:hf_api = HfApi(token=TOKEN)hf_api.upload_file(path_or_fileobj=request_path,path_in_repo=f"{provider}/{request_filename}",repo_id=QUEUE_REPO,repo_type="dataset",commit_message=f"Add evaluation request for {model_id}")return f"""✅ **Request submitted successfully!****Model:** `{model_id}`**Provider:** {provider}2 unmodified linesWe'll run the benchmark and update the leaderboard within a few days.{f"We'll contact you at: {contact}" if contact else ""}"""except Exception as e:return f"""⚠️ **Request saved locally but failed to upload to HuggingFace**Error: {str(e)}The request has been saved but needs manual upload. Please contact the maintainers."""except Exception as e:return f"❌ Failed to submit request: {str(e)}"### Space initialisationtry:30 unmodified lines3132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980812 unmodified lines8485868788899091929394959697989910010110210310430 unmodified linesdef submit_model_request(model_id: str, contact: str = "") -> str:"""Submit a model evaluation request"""try:if not model_id or not model_id.strip():return "❌ Please provide a model ID"model_id = model_id.strip()# Validate format (should have provider/model)if "/" not in model_id:return "❌ Model ID must include provider (e.g., `anthropic/claude-3-opus`)"provider, model_name = model_id.split("/", 1)# Check if already existsrequest_filename = f"{model_id.replace('/', '_')}_eval_request_False_float16_Original.json"# Create request objectrequest_data = {"model": model_id,"provider": provider,"base_model": "","revision": "main","precision": "float16","weight_type": "Original","status": "PENDING","submitted_time": datetime.now().isoformat() + "Z","submitted_by": contact if contact else "anonymous","model_type": "pretrained","likes": 0,"params": 0,"license": "?","private": False,}# Try to push to HF (if token available)if TOKEN:try:hf_api = HfApi(token=TOKEN)hf_api.upload_file(path_or_fileobj=json.dumps(request_data, indent=2).encode(),path_in_repo=f"{provider}/{request_filename}",repo_id=QUEUE_REPO,repo_type="dataset",commit_message=f"Add evaluation request for {model_id}")return f"""✅ **Request submitted successfully!****Model:** `{model_id}`**Provider:** {provider}2 unmodified linesWe'll run the benchmark and update the leaderboard within a few days.{f"We'll contact you at: {contact}" if contact else ""}"""except Exception as e:return f"""❌ **Failed to submit request**Error: {str(e)}Please try again or contact the maintainers directly."""else:return """❌ **Submission not configured**The leaderboard is not configured to accept submissions yet. Please contact the maintainers directly to request a model evaluation."""except Exception as e:return f"❌ Failed to process request: {str(e)}"### Space initialisationtry:
42 unmodified lines4344454647484938 unmodified lines8889909142 unmodified lines"""# Which evaluations are you running? how can people reproduce what you have?LLM_BENCHMARKS_TEXT = f"""## How it worksModels are prompted with ASCII maze representations and must output a sequence of directional moves (N, S, E, W) to navigate from Start (S) to End (E).38 unmodified linesCITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"CITATION_BUTTON_TEXT = r""""""42 unmodified lines4344454647484938 unmodified lines888990919293949596979842 unmodified lines"""# Which evaluations are you running? how can people reproduce what you have?LLM_BENCHMARKS_TEXT = """## How it worksModels are prompted with ASCII maze representations and must output a sequence of directional moves (N, S, E, W) to navigate from Start (S) to End (E).38 unmodified linesCITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"CITATION_BUTTON_TEXT = r"""@misc{pathfinding-benchmark-2025,title={Pathfinding Benchmark: Evaluating LLMs on ASCII Maze Navigation},author={Fallom AI},year={2025},url={https://huggingface.co/spaces/Fallomai/pathfinding-leaderboard},note={90 maze problems of varying complexity (5x5 to 20x20) generated using Prim's, Recursive Backtracker, and Cellular Automata algorithms}}"""
11 unmodified lines121314151617182 unmodified lines212223242526272829303132333435363738394041424344454611 unmodified lines# These classes are for user facing column names,# to avoid having to change them all around the code# when a modif is needed@dataclassclass ColumnContent:name: strtype: str2 unmodified linesnever_hidden: bool = False## Leaderboard columnsauto_eval_column_dict = []# Initauto_eval_column_dict.append(["model_type_symbol", ColumnContent, ColumnContent("T", "str", True, never_hidden=True)])auto_eval_column_dict.append(["model", ColumnContent, ColumnContent("Model", "markdown", True, never_hidden=True)])auto_eval_column_dict.append(["provider", ColumnContent, ColumnContent("Provider", "str", True)])# Main metricsauto_eval_column_dict.append(["completion_rate", ColumnContent, ColumnContent(Tasks.completion_rate.value.col_name, "number", True)])auto_eval_column_dict.append(["accuracy", ColumnContent, ColumnContent(Tasks.accuracy.value.col_name, "number", True)])auto_eval_column_dict.append(["avg_duration", ColumnContent, ColumnContent(Tasks.avg_duration.value.col_name, "number", True)])auto_eval_column_dict.append(["avg_tokens", ColumnContent, ColumnContent(Tasks.avg_tokens.value.col_name, "number", True)])auto_eval_column_dict.append(["total_cost", ColumnContent, ColumnContent(Tasks.total_cost.value.col_name, "number", True)])# Optional metricsauto_eval_column_dict.append(["optimal_rate", ColumnContent, ColumnContent(Tasks.optimal_rate.value.col_name, "number", False)])# Model informationauto_eval_column_dict.append(["model_type", ColumnContent, ColumnContent("Type", "str", False)])auto_eval_column_dict.append(["precision", ColumnContent, ColumnContent("Precision", "str", False)])auto_eval_column_dict.append(["revision", ColumnContent, ColumnContent("Model sha", "str", False, True)])# We use make dataclass to dynamically fill the scores from TasksAutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)## For the queue columns in the submission tab@dataclass(frozen=True)11 unmodified lines121314151617182 unmodified lines212223242526272829303132333435363738394011 unmodified lines# These classes are for user facing column names,# to avoid having to change them all around the code# when a modif is needed@dataclass(frozen=True)class ColumnContent:name: strtype: str2 unmodified linesnever_hidden: bool = False## Leaderboard columns@dataclass(frozen=True)class AutoEvalColumn:model_type_symbol: ColumnContent = ColumnContent("T", "str", True, never_hidden=True)model: ColumnContent = ColumnContent("Model", "markdown", True, never_hidden=True)provider: ColumnContent = ColumnContent("Provider", "str", True)completion_rate: ColumnContent = ColumnContent(Tasks.completion_rate.value.col_name, "number", True)accuracy: ColumnContent = ColumnContent(Tasks.accuracy.value.col_name, "number", True)avg_duration: ColumnContent = ColumnContent(Tasks.avg_duration.value.col_name, "number", True)avg_tokens: ColumnContent = ColumnContent(Tasks.avg_tokens.value.col_name, "number", True)total_cost: ColumnContent = ColumnContent(Tasks.total_cost.value.col_name, "number", True)optimal_rate: ColumnContent = ColumnContent(Tasks.optimal_rate.value.col_name, "number", False)model_type: ColumnContent = ColumnContent("Type", "str", False)precision: ColumnContent = ColumnContent("Precision", "str", False)revision: ColumnContent = ColumnContent("Model sha", "str", False, True)## For the queue columns in the submission tab@dataclass(frozen=True)
.DS_Store
app.py+47-58
src/about.py+8-1
src/display/utils.py+15-21