Skip to content

Commit

Permalink
Release reasy
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Oct 11, 2024
1 parent c77332d commit 03e027d
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 180 deletions.
2 changes: 0 additions & 2 deletions evals/models/openai/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def multiply_and_exponentiate():
),
question="What is 10*5 then to the power of 2? do it step by step",
ideal_answer="2500",
save_result_to_file="evals/results/calculator/{eval_id}.json",
)
result: Optional[EvalResult] = evaluation.print_result()

Expand All @@ -29,7 +28,6 @@ def factorial():
),
question="What is 10!?",
ideal_answer="3628800",
save_result_to_file="evals/results/calculator/{eval_id}.json",
)
result: Optional[EvalResult] = evaluation.print_result()

Expand Down
2 changes: 1 addition & 1 deletion phi/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import field_validator, Field
from pydantic_core.core_schema import ValidationInfo

from phi.base.infra import InfraBase
from phi.infra.base import InfraBase
from phi.app.context import ContainerContext
from phi.resource.base import ResourceBase
from phi.utils.log import logger
Expand Down
Empty file removed phi/base/__init__.py
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion phi/infra/resources.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional, List, Any, Tuple

from phi.base.infra import InfraBase
from phi.infra.base import InfraBase


class InfraResources(InfraBase):
Expand Down
10 changes: 6 additions & 4 deletions phi/model/openai/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,9 @@ def _update_usage_metrics(
elif isinstance(response_usage.prompt_tokens_details, BaseModel):
metrics.prompt_tokens_details = response_usage.prompt_tokens_details.model_dump(exclude_none=True)
assistant_message.metrics["prompt_tokens_details"] = metrics.prompt_tokens_details
for k, v in metrics.prompt_tokens_details.items():
self.metrics.get("prompt_tokens_details", {}).get(k, 0) + v
if metrics.prompt_tokens_details is not None:
for k, v in metrics.prompt_tokens_details.items():
self.metrics.get("prompt_tokens_details", {}).get(k, 0) + v
if response_usage.completion_tokens_details is not None:
if isinstance(response_usage.completion_tokens_details, dict):
metrics.completion_tokens_details = response_usage.completion_tokens_details
Expand All @@ -505,8 +506,9 @@ def _update_usage_metrics(
exclude_none=True
)
assistant_message.metrics["completion_tokens_details"] = metrics.completion_tokens_details
for k, v in metrics.completion_tokens_details.items():
self.metrics.get("completion_tokens_details", {}).get(k, 0) + v
if metrics.completion_tokens_details is not None:
for k, v in metrics.completion_tokens_details.items():
self.metrics.get("completion_tokens_details", {}).get(k, 0) + v

def _create_assistant_message(
self,
Expand Down
2 changes: 1 addition & 1 deletion phi/resource/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path
from typing import Any, Optional, Dict, List

from phi.base.infra import InfraBase
from phi.infra.base import InfraBase
from phi.utils.log import logger


Expand Down
2 changes: 1 addition & 1 deletion scripts/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ main() {
if [[ UPGRADE_ALL -eq 1 ]];
then
print_heading "Upgrading all dependencies to latest version"
CUSTOM_COMPILE_COMMAND="./scripts/upgrade.sh" \
CUSTOM_COMPILE_COMMAND="./scripts/upgrade.sh all" \
pip-compile --upgrade --no-annotate --pip-args "--no-cache-dir" \
-o ${ROOT_DIR}/requirements.txt \
${ROOT_DIR}/pyproject.toml
Expand Down
Empty file removed tests/llms/__init__.py
Empty file.
Empty file removed tests/llms/ollama/__init__.py
Empty file.
88 changes: 0 additions & 88 deletions tests/llms/ollama/multi_tool_test.py

This file was deleted.

42 changes: 0 additions & 42 deletions tests/llms/ollama/structured_output.py

This file was deleted.

Empty file removed tests/llms/openai/__init__.py
Empty file.
40 changes: 0 additions & 40 deletions tests/llms/openai/test_easy.py

This file was deleted.

0 comments on commit 03e027d

Please sign in to comment.