Skip to content
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 src/fhda/notebook_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def __init__(
directories from the aviary-storage GCS bucket. Should only be enabled if the
task requires data on GCS. Disabled by default.
run_notebook_on_edit: If True (default), the whole notebook will be rerun
after each edit. If False, only a the cell that was edited will be rerun.
after each edit. If False, only the cell that was edited will be rerun.
"""
self.work_dir = Path(work_dir)
self.nb_path = Path(nb_path) if nb_path else self.work_dir / self.NOTEBOOK_NAME
Expand Down
19 changes: 19 additions & 0 deletions src/fhda/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@
}


def configure_logging():
"""Configure logging for the application."""
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
)

loggers_config = {
"LiteLLM": logging.WARNING,
"LiteLLM Router": logging.WARNING,
"LiteLLM Proxy": logging.WARNING,
"httpx": logging.WARNING,
"httpcore.http11": logging.WARNING,
}

for logger_name, level in loggers_config.items():
logging.getLogger(logger_name).setLevel(level)


class NBLanguage(StrEnum):
PYTHON = auto()
R = auto()
Expand Down
14 changes: 7 additions & 7 deletions src/scripts/platform_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import pandas as pd
import logging
from pathlib import Path
from crow_client import CrowClient, JobResponseVerbose
from crow_client.models import AuthType, Stage
from futurehouse_client import FutureHouseClient, JobResponseVerbose
from futurehouse_client.models import AuthType, Stage
from aviary.utils import MultipleChoiceQuestion, eval_answer, EvalAnswerMode


Expand All @@ -33,9 +33,9 @@ def create_client(
api_key: Optional[str] = None,
stage: Stage = getattr(Stage, ENV),
organization: str = "FutureHouse",
) -> CrowClient:
"""Create and return a CrowClient instance."""
return CrowClient(
) -> FutureHouseClient:
"""Create and return a FutureHouseClient instance."""
return FutureHouseClient(
stage=stage,
organization=organization,
auth_type=AuthType.API_KEY,
Expand Down Expand Up @@ -64,12 +64,12 @@ def load_job_data(file_path: Union[str, Path]) -> List[Dict[str, Any]]:


async def fetch_jobs_batch(
client: CrowClient, job_ids: List[str], batch_size: int = 10
client: FutureHouseClient, job_ids: List[str], batch_size: int = 10
) -> List[Dict[str, Any]]:
"""Fetch jobs in batches to avoid memory issues.

Args:
client: CrowClient instance
client: FutureHouseClient instance
job_ids: List of job IDs to fetch
batch_size: Number of jobs to fetch in each batch

Expand Down
8 changes: 4 additions & 4 deletions src/scripts/platform_run_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import datasets
from ldp.agent import AgentConfig
from aviary.core import MultipleChoiceQuestion
from crow_client import CrowClient
from crow_client.models import Stage, JobRequest, RuntimeConfig
from crow_client.models.app import AuthType
from futurehouse_client import FutureHouseClient
from futurehouse_client.models import Stage, JobRequest, RuntimeConfig
from futurehouse_client.models.app import AuthType
import src.fhda.prompts as prompts

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -187,7 +187,7 @@ async def submit_jobs(
The answer string from the agent
"""

client = CrowClient(
client = FutureHouseClient(
stage=CROW_STAGE,
auth_type=AuthType.API_KEY,
api_key=API_KEY,
Expand Down