|
|
import requests |
|
|
from pathlib import Path |
|
|
import pandas as pd |
|
|
from typing import Tuple, List |
|
|
|
|
|
|
|
|
def is_model_on_hub(model_name: str) -> Tuple[bool, str]: |
|
|
""" |
|
|
Check if a model exists on Hugging Face Hub. |
|
|
Returns (is_on_hub, error_message) |
|
|
""" |
|
|
try: |
|
|
|
|
|
if "/" not in model_name: |
|
|
return False, "Model name must be in format 'username/model_name'" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return True, "" |
|
|
except Exception as e: |
|
|
return False, f"Error checking model: {str(e)}" |
|
|
|
|
|
def upload_file(filename: str, filepath: Path) -> None: |
|
|
""" |
|
|
Upload a file to the dataset hub. |
|
|
In a real implementation, this would upload to Hugging Face Hub. |
|
|
""" |
|
|
|
|
|
print(f"Uploading {filename} from {filepath}") |
|
|
|
|
|
pass |
|
|
|
|
|
def load_all_info_from_dataset_hub() -> Tuple[Path, List[str], Path, None]: |
|
|
""" |
|
|
Load evaluation queue, requested models, and results from dataset hub. |
|
|
Returns (eval_queue_repo, requested_models, jsonl_results, multilingual_jsonl_path) |
|
|
""" |
|
|
|
|
|
eval_queue_repo = Path("evaluation_queue") |
|
|
requested_models = [] |
|
|
|
|
|
|
|
|
jsonl_results = Path("imagenet_results.jsonl") |
|
|
|
|
|
return eval_queue_repo, requested_models, jsonl_results, None |
|
|
|