Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions affine/miners.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ async def check_model_gated(
is_gated = r.json().get("gated", False)
if revision:
try:
ok = await asyncio.to_thread(
lambda: bool(
HfApi(token=os.getenv("HF_TOKEN")).repo_info(
repo_id=model_id,
revision=revision,
repo_type="model",
)
# Get HuggingFace repo info to compare revisions
hf_info = await asyncio.to_thread(
lambda: HfApi(token=os.getenv("HF_TOKEN")).repo_info(
repo_id=model_id,
repo_type="model",
)
)
if not ok:
hf_revision = getattr(hf_info, "sha", None)
# If miner revision doesn't match HF revision, treat as gated
if hf_revision and hf_revision != revision:
is_gated = True
except:
pass
Expand Down Expand Up @@ -318,10 +318,6 @@ async def _fetch_miner(uid: int) -> Optional["Miner"]:
if uid != 0 and chute_name.split("/")[1].lower()[:6] != "affine":
return None

chute_revision = chute.get("revision")
if chute_revision is not None and miner_revision != chute_revision:
return None

return Miner(
uid=uid,
hotkey=hotkey,
Expand Down
2 changes: 1 addition & 1 deletion affine/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SamplingConfig:

# Challenge algorithm parameters
# Confidence level for Beta distribution interval (can be adjusted easily)
CONFIDENCE_LEVEL = 0.90 # confidence level
CONFIDENCE_LEVEL = 0.85 # confidence level

# Beta distribution prior parameters (Jeffrey's prior for binomial proportion)
BETA_PRIOR_ALPHA = 0.5
Expand Down