chore: 简化格式并更新文档
This commit is contained in:
@@ -7,7 +7,7 @@ from abc import ABC, abstractmethod
|
||||
from torch import Tensor
|
||||
from torch.utils.data import Dataset
|
||||
from khaosz.data.serialization import load_h5
|
||||
from typing import Callable, List, Dict, Literal, Optional, Union
|
||||
from typing import List, Dict, Optional, Union
|
||||
|
||||
|
||||
class BaseSegmentFetcher:
|
||||
|
||||
@@ -75,7 +75,7 @@ class Checkpoint:
|
||||
with open(save_path / "meta.json", "w") as f:
|
||||
json.dump(meta, f, indent=2)
|
||||
|
||||
st.save_file(self.state_dict, save_path / f"state_dict.safetensors")
|
||||
st.save_file(self.state_dict, save_path / "state_dict.safetensors")
|
||||
|
||||
@classmethod
|
||||
def load(
|
||||
@@ -96,7 +96,7 @@ class Checkpoint:
|
||||
dist.broadcast_object_list(meta_list, src=0)
|
||||
meta = meta_list[0]
|
||||
|
||||
state_dict = st.load_file(save_path / f"state_dict.safetensors")
|
||||
state_dict = st.load_file(save_path / "state_dict.safetensors")
|
||||
|
||||
return cls(
|
||||
state_dict=state_dict,
|
||||
|
||||
Reference in New Issue
Block a user