fix: read file encoding error (#1902)
Co-authored-by: maple <1071520@gi>
This commit is contained in:
parent
ca85b0afbe
commit
0e239a4f71
5 changed files with 7 additions and 7 deletions
|
|
@ -147,13 +147,13 @@ class AIModel(ABC):
|
|||
# read _position.yaml file
|
||||
position_map = {}
|
||||
if os.path.exists(position_file_path):
|
||||
with open(position_file_path, 'r') as f:
|
||||
with open(position_file_path, 'r', encoding='utf-8') as f:
|
||||
position_map = yaml.safe_load(f)
|
||||
|
||||
# traverse all model_schema_yaml_paths
|
||||
for model_schema_yaml_path in model_schema_yaml_paths:
|
||||
# read yaml data from yaml file
|
||||
with open(model_schema_yaml_path, 'r') as f:
|
||||
with open(model_schema_yaml_path, 'r', encoding='utf-8') as f:
|
||||
yaml_data = yaml.safe_load(f)
|
||||
|
||||
new_parameter_rules = []
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class ModelProvider(ABC):
|
|||
yaml_path = os.path.join(current_path, f'{provider_name}.yaml')
|
||||
yaml_data = {}
|
||||
if os.path.exists(yaml_path):
|
||||
with open(yaml_path, 'r') as f:
|
||||
with open(yaml_path, 'r', encoding='utf-8') as f:
|
||||
yaml_data = yaml.safe_load(f)
|
||||
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ class ModelProviderFactory:
|
|||
# read _position.yaml file
|
||||
position_map = {}
|
||||
if os.path.exists(position_file_path):
|
||||
with open(position_file_path, 'r') as f:
|
||||
with open(position_file_path, 'r', encoding='utf-8') as f:
|
||||
position_map = yaml.safe_load(f)
|
||||
|
||||
# traverse all model_provider_dir_paths
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue