+
Skip to content

Conversation

swfsql
Copy link
Contributor

@swfsql swfsql commented Feb 1, 2024

  • Makes the safetensors module private.
    • Doesn't get exported on the preamble, avoiding a naming clash with the safetensors external crate for apps that use dfdx.
  • Change how and when the period . is inserted.
    • This should make it closer to how the fields are accessed in the code.
  • For load, read, save, write safetensor(s), add a _with method:
    • Requires load/read to decide whether it should skip missing tensors;
    • Requires load/read/save/write to decide how should keys be mapped.
    • This makes it easier to load/save from/to models that were not saved by dfdx and thus contains a different safetensors key/location structuring.
  • Allow models to get built from a safetensors byte array data (not from reading a file).

This doesn't have much testing nor documentation updates, so this PR should be considered a draft.

@swfsql swfsql mentioned this pull request Feb 7, 2024
13 tasks
@swfsql swfsql changed the title Update safetensors module and naming Safetensors changes Feb 9, 2024
@swfsql swfsql marked this pull request as draft March 1, 2024 14:56
swfsql added 4 commits March 1, 2024 15:46
- Makes the safetensors module private.
  - Doesn't get exported on the preamble, avoiding a naming clash with the safetensors external crate.
- Change how and when the period is inserted.
  - This should make it closer to how the fields are accessed in the code.
This alternative method:
- Requires load/read to decide whether it should skip missing tensors;
- Requires load/read/save/write to decide how should keys be mapped.
@swfsql swfsql force-pushed the safetensors-change branch from 45226f5 to 95e619f Compare March 1, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载