Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, ai_model_path: str, **kwargs) -> None:
raise ImportError("onnxruntime-genai is not installed.")
try:
json_gen_ai_config = os.path.join(ai_model_path + "/genai_config.json")
with open(json_gen_ai_config) as file:
with open(json_gen_ai_config, encoding="utf-8") as file:
config: dict = json.load(file)
enable_multi_modality = "vision" in config.get("model", {})
model = OnnxRuntimeGenAi.Model(ai_model_path)
Expand Down
4 changes: 2 additions & 2 deletions python/semantic_kernel/contents/chat_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def store_chat_history_to_file(self, file_path: str) -> None:
file_path: The path to the file where the serialized data will be stored.
"""
json_str = self.serialize()
with open(file_path, "w") as local_file:
with open(file_path, "w", encoding="utf-8") as local_file:
local_file.write(json_str)

@classmethod
Expand All @@ -442,6 +442,6 @@ def load_chat_history_from_file(cls: type[_T], file_path: str) -> _T:
Returns:
ChatHistory: The deserialized ChatHistory instance.
"""
with open(file_path) as file:
with open(file_path, encoding="utf-8") as file:
json_str = file.read()
return cls.restore_chat_history(json_str)
Loading