Skip to content
This repository was archived by the owner on Jun 6, 2025. It is now read-only.
Merged
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
2 changes: 1 addition & 1 deletion neurons/miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def forward(
self.logger.info(f"Using {jobs_dir.absolute()} as the directory for code repositories")

self.logger.info(f"Cloning repo {repo}...")
local_repo_dir = clone_repo(author_name, repo_name, current_dir.parent, logger=self.logger)
local_repo_dir = clone_repo(author_name, repo_name, current_dir.parent, logger=self.logger, base_commit=synapse.base_commit)
self.logger.info(f"Finished cloning repo {repo}")

if repo not in SUPPORTED_REPOS:
Expand Down
11 changes: 7 additions & 4 deletions ridges/helpers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from logging import Logger

def clone_repo(author_name: str, repo_name: str, base_path: Path, logger: Logger) -> Path:
def clone_repo(author_name: str, repo_name: str, base_path: Path, logger: Logger, base_commit: str = None) -> Path:
"""
Clone a GitHub repository to a specified directory under 'repos' and return the path.

Expand All @@ -26,11 +26,14 @@ def clone_repo(author_name: str, repo_name: str, base_path: Path, logger: Logger
shutil.rmtree(clone_to_path)
logger.debug(f"Directory {clone_to_path} has been removed.")

Repo.clone_from(f"https://github.com/{author_name}/{repo_name}.git", clone_to_path)
repo = Repo.clone_from(f"https://github.com/{author_name}/{repo_name}.git", clone_to_path)
logger.debug(f"Repository cloned to {clone_to_path}")
if base_commit:
repo.git.checkout(base_commit)
logger.debug(f"Checked out base commit {base_commit}")
return clone_to_path
except Exception:
logger.exception(f"Failed to clone repository")
except Exception as e:
logger.exception(f"Failed to clone repository: {e}")
raise


Expand Down
1 change: 1 addition & 0 deletions ridges/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class CodingTask(bt.Synapse):

########################## Payload definition ##############################
repo: str # Format: <author>/<name>
base_commit: Optional[str] = None # The base commit to use for the benchmark

# The issue description
problem_statement: str
Expand Down