Skip to content

Commit

Permalink
Bumped release version
Browse files Browse the repository at this point in the history
  • Loading branch information
mstfbl committed Jan 9, 2025
1 parent 4581378 commit 6d6ffce
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nomadic/experiment/rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ def run_inference_pipeline(params_dict: Dict[str, Any]) -> RunResult:
"detailed_results": detailed_results,
"mean_score": mean_score,
}
if params_dict["enable_logging"]:
if "enable_logging" in params_dict:
# Save inference results to a file
with open("inference_results.json", "w") as f:
json.dump(inference_results, f)
Expand Down
4 changes: 2 additions & 2 deletions nomadic/result/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from nomadic.result.base import RunResult, ExperimentResult
from nomadic.result.base import RunResult, ExperimentResult, load_run_results_from_file

__all__ = ["RunResult", "ExperimentResult"]
__all__ = ["RunResult", "ExperimentResult", load_run_results_from_file]
19 changes: 19 additions & 0 deletions nomadic/result/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import base64
import json
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field

Expand Down Expand Up @@ -87,3 +89,20 @@ def to_df(self, include_metadata=True) -> pd.DataFrame:
data.append(experiment_metadata)

return pd.DataFrame(data)

def load_run_results_from_file(filepath: str) -> List[RunResult]:
"""
Loads a list of dictionaries from a JSON file,
converting each dictionary into a RunResult object.
"""
with open(filepath, "r", encoding="utf-8") as file:
data = json.load(file)

run_results = []
for item in data:
if "visualization" in item and item["visualization"] is not None:
item["visualization"] = base64.b64decode(item["visualization"])

run_results.append(RunResult(**item))

return run_results
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ python_version = "3.11.9"

[tool.poetry]
name = "nomadic"
version = "0.0.1.3"
version = "0.0.1.6"
description = "Nomadic is an enterprise-grade toolkit for teams to continuously optimize compound AI systems"
authors = ["Mustafa Bal <[email protected]>"]
classifiers = [
Expand Down

0 comments on commit 6d6ffce

Please sign in to comment.