Skip to content

Commit

Permalink
feat: enable commit reveal V3 (#100)
Browse files Browse the repository at this point in the history
* chore: remove dead code

* build: update deps

* chore: add pyright ignore folders

* build: update bittensor version

* chore: update pyproject

* fix: update import

* build: bump to bittensor 8.5.1

* fix: posixpath pystring compatibility
  • Loading branch information
jarvis8x7b authored Dec 20, 2024
1 parent c4e5b3b commit 42f06f7
Show file tree
Hide file tree
Showing 29 changed files with 34 additions and 261 deletions.
2 changes: 1 addition & 1 deletion auto_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import time
from datetime import datetime

from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger

from commons.utils import datetime_to_iso8601_str
from dojo import __version__
Expand Down
2 changes: 1 addition & 1 deletion commons/api/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from ipaddress import ip_address, ip_network

import httpx
from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger
from fastapi import Request
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.responses import Response
Expand Down
2 changes: 1 addition & 1 deletion commons/api/reward_route.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger
from fastapi import APIRouter, Header, Request, responses
from fastapi.encoders import jsonable_encoder
from pydantic.error_wrappers import ValidationError
Expand Down
172 changes: 0 additions & 172 deletions commons/dataset/leaderboard.py

This file was deleted.

2 changes: 1 addition & 1 deletion commons/dataset/synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import traceback

import aiohttp
from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger
from tenacity import (
AsyncRetrying,
RetryError,
Expand Down
2 changes: 1 addition & 1 deletion commons/human_feedback/dojo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Dict, List

import httpx
from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger

import dojo
from commons.exceptions import CreateTaskFailed
Expand Down
51 changes: 0 additions & 51 deletions commons/llm/openai_proxy.py

This file was deleted.

2 changes: 1 addition & 1 deletion commons/logging/patch_logging.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import inspect
import os

from bittensor.btlogging import logging
from bittensor.utils.btlogging import logging


def custom_format(cls, prefix: object, suffix: object = None):
Expand Down
2 changes: 1 addition & 1 deletion commons/obfuscation/obfuscation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import time
from functools import partial

from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger
from bs4 import BeautifulSoup
from jsmin import jsmin

Expand Down
2 changes: 1 addition & 1 deletion commons/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import AsyncGenerator, List

import torch
from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger

from commons.exceptions import (
ExpiredFromMoreThanExpireTo,
Expand Down
2 changes: 1 addition & 1 deletion commons/score_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path

import torch
from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger

from database.client import connect_db
from database.prisma.models import Score_Model
Expand Down
2 changes: 1 addition & 1 deletion commons/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pingouin as pg
import torch
from attr import define, field
from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger
from pydantic import BaseModel, Field
from scipy.stats import spearmanr
from torch.nn import functional as F
Expand Down
7 changes: 1 addition & 6 deletions commons/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
from typing import Any, Tuple

import bittensor as bt
import jsonref
import numpy as np
import plotext
import requests
import torch
import wandb
from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger
from Crypto.Hash import keccak
from tenacity import RetryError, Retrying, stop_after_attempt, wait_exponential_jitter

Expand Down Expand Up @@ -288,10 +287,6 @@ def remove_key(input_dict, key, depth=0):
return input_dict


def _resolve_references(json_str):
return jsonref.loads(json_str)


# LRU Cache with TTL
def ttl_cache(maxsize: int = 128, typed: bool = False, ttl: int = -1):
"""
Expand Down
2 changes: 1 addition & 1 deletion database/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio
from contextlib import asynccontextmanager

from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger

from database.prisma import Prisma

Expand Down
2 changes: 1 addition & 1 deletion dojo/base/miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import threading
import traceback

from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger

from commons.utils import serve_axon
from dojo.base.neuron import BaseNeuron
Expand Down
2 changes: 1 addition & 1 deletion dojo/base/neuron.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from abc import ABC, abstractmethod

import bittensor as bt
from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger

from commons.objects import ObjectManager
from commons.utils import initialise, ttl_get_block
Expand Down
2 changes: 1 addition & 1 deletion dojo/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pathlib import Path

import bittensor as bt
from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger
from dotenv import find_dotenv, load_dotenv

base_path = Path.cwd()
Expand Down
2 changes: 1 addition & 1 deletion dojo/utils/uids.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import bittensor as bt
import torch
from bittensor.btlogging import logging as logger
from bittensor.utils.btlogging import logging as logger

from commons.utils import keccak256_hash

Expand Down
4 changes: 2 additions & 2 deletions dojo_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ def main():
.lower()
)
if use_default_path == "y":
config.wallet.path = default_wallet_path
config.wallet.path = str(default_wallet_path)
is_wallet_path_decided = True
elif use_default_path == "n":
config.wallet.path = input("Enter the wallet path: ").strip()
config.wallet.path = str(input("Enter the wallet path: ").strip())
if Path(config.wallet.path).expanduser().exists():
is_wallet_path_decided = True
else:
Expand Down
Loading

0 comments on commit 42f06f7

Please sign in to comment.