Skip to content

Commit

Permalink
refactor: sign image only
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <[email protected]>
  • Loading branch information
thxCode committed Nov 20, 2024
1 parent 009faaa commit ee77523
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions file_estimate__llamacpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ type (
EmbeddingOnly bool `json:"embeddingOnly"`
// Reranking is the flag to indicate whether the model is used for reranking,
// true for reranking.
//
// Only available when EmbeddingOnly is true.
Reranking bool `json:"reranking"`
// Distributable is the flag to indicate whether the model is distributable,
// true for distributable.
Expand Down Expand Up @@ -693,6 +695,8 @@ type (
EmbeddingOnly bool `json:"embeddingOnly"`
// Reranking is the flag to indicate whether the model is used for reranking,
// true for reranking.
//
// Only available when EmbeddingOnly is true.
Reranking bool `json:"reranking"`
// Distributable is the flag to indicate whether the model is distributable,
// true for distributable.
Expand Down
10 changes: 10 additions & 0 deletions file_estimate__stablediffusioncpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ type (
// NoMMap is the flag to indicate whether support the mmap,
// true for support.
NoMMap bool `json:"noMMap"`
// ImageOnly is the flag to indicate whether the model is used for generating image,
// true for embedding only.
ImageOnly bool `json:"imageOnly"`
// Distributable is the flag to indicate whether the model is distributable,
// true for distributable.
Distributable bool `json:"distributable"`
Expand Down Expand Up @@ -122,6 +125,9 @@ func (gf *GGUFFile) EstimateStableDiffusionCppRun(opts ...GGUFRunEstimateOption)
// NoMMap.
e.NoMMap = true // TODO: Implement this.

// ImageOnly.
e.ImageOnly = true // TODO: Implement this.

// Autoencoder.
if a.DiffusionAutoencoder != nil {
e.Autoencoder = &StableDiffusionCppRunEstimate{
Expand Down Expand Up @@ -252,6 +258,9 @@ type (
// NoMMap is the flag to indicate whether the file must be loaded without mmap,
// true for total loaded.
NoMMap bool `json:"noMMap"`
// ImageOnly is the flag to indicate whether the model is used for generating image,
// true for embedding only.
ImageOnly bool `json:"imageOnly"`
// Distributable is the flag to indicate whether the model is distributable,
// true for distributable.
Distributable bool `json:"distributable"`
Expand Down Expand Up @@ -382,6 +391,7 @@ func (e StableDiffusionCppRunEstimate) Summarize(
es.Architecture = e.Architecture
es.FlashAttention = e.FlashAttention
es.NoMMap = e.NoMMap
es.ImageOnly = e.ImageOnly
es.Distributable = e.Distributable

return es
Expand Down

0 comments on commit ee77523

Please sign in to comment.