Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Cifko committed Aug 22, 2024
1 parent 86de9e5 commit 1a3f9fe
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions atoma-event-subscribe/sui/src/subscriber.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{fmt::Write, path::Path, str::FromStr, time::Duration};
use std::{path::Path, str::FromStr, time::Duration};

use futures::StreamExt;
use serde_json::Value;
Expand All @@ -16,7 +16,6 @@ use crate::AtomaEvent;
use atoma_types::{InputSource, Request, SmallId, NON_SAMPLED_NODE_ERR};

/// The size of a request id, expressed in hex format
const REQUEST_ID_HEX_SIZE: usize = 64;
const WAIT_FOR_INPUT_MANAGER_RESPONSE_SECS: u64 = 5;

/// `SuiSubscriber` - Responsible for listening to events emitted from the Atoma smart contract
Expand Down
2 changes: 1 addition & 1 deletion atoma-inference/src/models/candle/stable_diffusion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ impl StableDiffusion {

/// Pre-processes image
fn image_preprocess<T: AsRef<std::path::Path>>(path: T) -> Result<Tensor, ModelError> {
let img = image::io::Reader::open(path)?.decode()?;
let img = image::ImageReader::open(path)?.decode()?;
let (height, width) = (img.height() as usize, img.width() as usize);
let height = height - height % 32;
let width = width - width % 32;
Expand Down
2 changes: 1 addition & 1 deletion atoma-inference/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub enum ModelServiceError {

#[cfg(test)]
mod tests {
use atoma_types::PromptParams;
use atoma_types::{Digest, PromptParams};
use serde::Serialize;
use std::io::Write;
use toml::{toml, Value};
Expand Down
4 changes: 3 additions & 1 deletion atoma-inference/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ async fn test_mock_model_thread() {
let (response_sender, response_receiver) = oneshot::channel();
let max_tokens = i as u64;
let prompt_params = PromptParams::Text2TextPromptParams(Text2TextPromptParams::new(
"".to_string(),
atoma_types::InputSource::Raw {
prompt: "".to_string(),
},
"".to_string(),
0.0,
1,
Expand Down
2 changes: 1 addition & 1 deletion atoma-input-manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl AtomaInputManager {
};
oneshot
.send(text)
.map_err(|e| AtomaInputManagerError::SendPromptError(e))?;
.map_err(AtomaInputManagerError::SendPromptError)?;
}

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion atoma-streamer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl AtomaStreamer {
.map_err(|_| AtomaStreamerError::UrlError("URL is cannot-be-a-base".to_string()))?;
path_segment.push("data");
path_segment.push(&request_id);
path_segment.push(&format!("response.json"));
path_segment.push("response.json");
}
url.set_query(Some(&format!("auth={token}")));
info!("Firebase's output url: {:?}", url);
Expand Down

0 comments on commit 1a3f9fe

Please sign in to comment.