summaryrefslogtreecommitdiff
path: root/candle-transformers
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2024-09-28 14:41:28 +0200
committerGitHub <noreply@github.com>2024-09-28 14:41:28 +0200
commit62525e83526465b2d7969c8d3d0213b491b7ccc8 (patch)
tree40cfc61438d654bd0ddc8db322c617f5d9f9b5b2 /candle-transformers
parent2c25754281fb6672b9ebf84f6f6f5a5b12efe10d (diff)
downloadcandle-62525e83526465b2d7969c8d3d0213b491b7ccc8.tar.gz
candle-62525e83526465b2d7969c8d3d0213b491b7ccc8.tar.bz2
candle-62525e83526465b2d7969c8d3d0213b491b7ccc8.zip
Remove some extra whitelines. (#2513)
Diffstat (limited to 'candle-transformers')
-rw-r--r--candle-transformers/src/models/fastvit.rs1
-rw-r--r--candle-transformers/src/models/mobileclip.rs4
2 files changed, 0 insertions, 5 deletions
diff --git a/candle-transformers/src/models/fastvit.rs b/candle-transformers/src/models/fastvit.rs
index 81998742..b7bdaf88 100644
--- a/candle-transformers/src/models/fastvit.rs
+++ b/candle-transformers/src/models/fastvit.rs
@@ -495,7 +495,6 @@ fn fastvit_model(cfg: &Config, nclasses: Option<usize>, vb: VarBuilder) -> Resul
.apply(&stage3)?
.apply(&stage4)?
.apply(&final_conv)?;
-
match &cls {
None => Ok(xs),
Some(cls) => xs.mean(D::Minus2)?.mean(D::Minus1)?.apply(cls),
diff --git a/candle-transformers/src/models/mobileclip.rs b/candle-transformers/src/models/mobileclip.rs
index 4953d835..45a5dbad 100644
--- a/candle-transformers/src/models/mobileclip.rs
+++ b/candle-transformers/src/models/mobileclip.rs
@@ -22,7 +22,6 @@ impl MobileClipConfig {
pub fn s1() -> Self {
let text_config = text_model::Config::vit_base_patch32();
let vision_config = fastvit::Config::mci1();
-
Self {
text_config,
vision_config,
@@ -32,7 +31,6 @@ impl MobileClipConfig {
pub fn s2() -> Self {
let text_config = text_model::Config::vit_base_patch32();
let vision_config = fastvit::Config::mci2();
-
Self {
text_config,
vision_config,
@@ -45,12 +43,10 @@ impl MobileClipModel {
pub fn new(vs: VarBuilder, c: &MobileClipConfig) -> Result<Self> {
let vision_model = fastvit::fastvit(&c.vision_config, 512, vs.pp("visual.trunk"))?;
let text_model = text_model::OpenClipTextTransformer::new(vs.pp("text"), &c.text_config)?;
-
let text_projection = vs.get(
(c.text_config.embed_dim, c.text_config.projection_dim),
"text.text_projection",
)?;
-
let logit_scale = vs.get(&[], "logit_scale")?;
Ok(Self {
text_model,