Skip to content

Commit

Permalink
Merge pull request #17 from soldni/soldni/logger
Browse files Browse the repository at this point in the history
Switched to logger instead of print statement
  • Loading branch information
vprelovac authored Oct 1, 2023
2 parents fb3cf2b + 675dae5 commit 65d5e4e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions llms/llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
import concurrent.futures
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import List, Optional, Tuple, Type, Union
from logging import getLogger


LOGGER = getLogger(__name__)


@dataclass
Expand Down Expand Up @@ -46,6 +50,7 @@ def __init__(self,
**kwargs
):
"""Programmatically load api keys and instantiate providers."""

for provider in [p for p in self._possible_providers if p.api_key_name]:
assert provider.api_key_name # for static type checking only
api_key = None
Expand All @@ -65,7 +70,7 @@ def __init__(self,
for single_model in self._models:
for provider in self._possible_providers:
if single_model in provider.provider.MODEL_INFO:
print(f"Found {single_model} in {provider.provider.__name__}")
LOGGER.info(f"Found {single_model} in {provider.provider.__name__}")
if provider.api_key:
self._providers.append(provider.provider(api_key=provider.api_key, model=single_model))
elif not provider.needs_api_key:
Expand Down Expand Up @@ -217,7 +222,7 @@ def benchmark(self, problems=None, evaluator=None, show_outputs=False, html=Fals
Email: first.name.wild🐻@email.com\
Phone: 5551112222\
",
),
),
("Please count the number of t in eeooeotetto", "3"),
(
"Use m to substitute p, a to substitute e, n to substitute a, g to substitute c, o to substitute h,\
Expand Down Expand Up @@ -269,7 +274,7 @@ def benchmark(self, problems=None, evaluator=None, show_outputs=False, html=Fals
Question: Is there a series of flights that goes from city F to city I?", "No"),
('Bob (a boy) has 3 sisters. Each sister has 2 brothers. How many brothers does Bob have?', '1')
]


def evaluate_answers(
evaluator, query_answer_pairs: List[Tuple[str, str]]
Expand Down

0 comments on commit 65d5e4e

Please sign in to comment.