Skip to content

Commit

Permalink
加速hf模型读取
Browse files Browse the repository at this point in the history
  • Loading branch information
黄宇扬 committed Jun 6, 2024
1 parent 5d8daf1 commit 79d2016
Show file tree
Hide file tree
Showing 3 changed files with 367 additions and 92 deletions.
4 changes: 4 additions & 0 deletions include/fastllm.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ namespace fastllm {

Data (const Data &ori); // 深拷贝

void CreateFromOriData(WeightType weightType, DataType oriDataType, uint8_t *oriData, int groupCnt = -1); // 从oriData中创建

void CopyFrom(const Data &ori); // 复制

void FakeFrom(const Data &ori, size_t offset); // 将data指针指向ori的data + offset,delete时不销毁
Expand Down Expand Up @@ -461,6 +463,8 @@ namespace fastllm {

void AddAdapterDict(const std::string &name, const std::string &key, const std::string &value);

void AddEmptyWeight(const std::string &key, const std::vector<int> &dims, fastllm::DataType dataType);

void AddWeight(const std::string &key, const std::vector <int> &dims,
DataType dataType, WeightType weightType, DataType oriDataType, uint8_t *oriData,
int groupCnt = -1); // 插入一个权重
Expand Down
Loading

0 comments on commit 79d2016

Please sign in to comment.