Using an exported Flow JSON file with load_flow_from_json("path/to/flow.json") returns

"UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 9465: character maps to
<undefined>".

Specifying the encodint type in the function helps to fix that error.
This commit is contained in:
Petru Molla 2023-04-17 17:38:44 +03:00 committed by Gabriel Luiz Freitas Almeida
commit 68f69e878e

View file

@ -87,7 +87,7 @@ def load_flow_from_json(path: str):
from langflow.graph import Graph
"""Load flow from json file"""
with open(path, "r") as f:
with open(path, "r", encoding='utf-8') as f:
flow_graph = json.load(f)
data_graph = flow_graph["data"]
nodes = data_graph["nodes"]