Remove some unusued bits. (#1067)

This commit is contained in:
Laurent Mazare
2023-10-09 20:49:57 +02:00
committed by GitHub
parent 4d04ac83c7
commit b34d7f0248
5 changed files with 2 additions and 18 deletions

View File

@ -25,7 +25,6 @@ impl ParamsConv1D {
} }
} }
#[allow(unused)]
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum CudnnFwdAlgo { pub enum CudnnFwdAlgo {
ImplicitGemm, ImplicitGemm,
@ -51,7 +50,7 @@ pub struct ParamsConv2D {
pub(crate) padding: usize, pub(crate) padding: usize,
pub(crate) stride: usize, pub(crate) stride: usize,
pub(crate) dilation: usize, pub(crate) dilation: usize,
pub(crate) cudnn_fwd_algo: Option<CudnnFwdAlgo>, pub cudnn_fwd_algo: Option<CudnnFwdAlgo>,
} }
impl ParamsConv2D { impl ParamsConv2D {

View File

@ -104,7 +104,6 @@ enum StableDiffusionVersion {
Xl, Xl,
} }
#[allow(unused)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum ModelFile { enum ModelFile {
Tokenizer, Tokenizer,

View File

@ -1,5 +1,3 @@
#![allow(unused)]
#[cfg(feature = "accelerate")] #[cfg(feature = "accelerate")]
extern crate accelerate_src; extern crate accelerate_src;
@ -10,7 +8,7 @@ use candle_transformers::models::stable_diffusion;
use candle_transformers::models::wuerstchen; use candle_transformers::models::wuerstchen;
use anyhow::{Error as E, Result}; use anyhow::{Error as E, Result};
use candle::{DType, Device, IndexOp, Module, Tensor, D}; use candle::{DType, Device, IndexOp, Tensor};
use clap::Parser; use clap::Parser;
use tokenizers::Tokenizer; use tokenizers::Tokenizer;
@ -80,14 +78,6 @@ struct Args {
/// The file specifying the tokenizer to used for prior tokenization. /// The file specifying the tokenizer to used for prior tokenization.
prior_tokenizer: Option<String>, prior_tokenizer: Option<String>,
/// The size of the sliced attention or 0 for automatic slicing (disabled by default)
#[arg(long)]
sliced_attention_size: Option<usize>,
/// The number of steps to run the diffusion for.
#[arg(long, default_value_t = 30)]
n_steps: usize,
/// The number of samples to generate. /// The number of samples to generate.
#[arg(long, default_value_t = 1)] #[arg(long, default_value_t = 1)]
num_samples: i64, num_samples: i64,
@ -220,10 +210,8 @@ fn run(args: Args) -> Result<()> {
cpu, cpu,
height, height,
width, width,
n_steps,
tokenizer, tokenizer,
final_image, final_image,
sliced_attention_size,
num_samples, num_samples,
clip_weights, clip_weights,
prior_weights, prior_weights,

View File

@ -3,7 +3,6 @@ use candle_nn::VarBuilder;
use candle_wasm_example_sam as sam; use candle_wasm_example_sam as sam;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[allow(unused)]
struct Embeddings { struct Embeddings {
original_width: u32, original_width: u32,
original_height: u32, original_height: u32,

View File

@ -84,7 +84,6 @@ pub struct Segment {
pub dr: DecodingResult, pub dr: DecodingResult,
} }
#[allow(unused)]
pub struct Decoder { pub struct Decoder {
model: Model, model: Model,
rng: rand::rngs::StdRng, rng: rand::rngs::StdRng,