Transformers Utils: Fix file read
Use asynchronous JSON reading Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
62beb2b1c8
commit
7baef05b49
1 changed files with 2 additions and 1 deletions
|
|
@ -23,7 +23,8 @@ class GenerationConfig(BaseModel):
|
|||
async with aiofiles.open(
|
||||
generation_config_path, "r", encoding="utf8"
|
||||
) as generation_config_json:
|
||||
generation_config_dict = json.load(generation_config_json)
|
||||
contents = await generation_config_json.read()
|
||||
generation_config_dict = json.loads(contents)
|
||||
return cls.model_validate(generation_config_dict)
|
||||
|
||||
def eos_tokens(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue