Skip to content

Commit 5290f9b

Browse files
authored
chore: Bump up dependencies versions + cosmetic fixes. (#7)
* chore: Bump up dependencies versions + cosmetic fixes. * fix: Remove trufflehog postgres buggy detector.
1 parent 0ff411a commit 5290f9b

File tree

7 files changed

+21
-23
lines changed

7 files changed

+21
-23
lines changed

.github/workflows/trufflehog.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
- name: Secret Scanning
1616
uses: trufflesecurity/trufflehog@main
1717
with:
18-
extra_args: --exclude-globs='test_data/.*'
18+
extra_args: --exclude-globs='test_data/.*' --results=verified,unknown --exclude-detectors=postgres

Cargo.toml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "inference-benchmarker"
3-
version = "1.0.0"
3+
version = "1.1.0"
44
edition = "2021"
55
authors = ["Hugo Larcher <[email protected]>"]
66
repository = "https://github.com/huggingface/inference-benchmarker"
@@ -16,26 +16,24 @@ serde_json = "1.0.127"
1616
serde = { version = "1.0.209", features = ["derive"] }
1717
tokio = { version = "1.40.0", features = ["rt", "rt-multi-thread", "macros", "signal"] }
1818
anyhow = "1.0.86"
19-
tokenizers = { version = "0.20.2", features = ["http"] }
20-
rand_distr = "0.4.3"
21-
rand = "0.8.5"
19+
tokenizers = { version = "0.21.1", features = ["http"] }
20+
rand_distr = "0.5.1"
21+
rand = "0.9.0"
2222
futures-util = "0.3.30"
2323
env_logger = "0.11.5"
24-
trait-variant = "0.1.2"
2524
async-trait = "0.1.82"
2625
reqwest = { version = "0.12.7", features = ["json"] }
27-
tokio-stream = "0.1.16"
28-
strum_macros = "0.26.4"
26+
strum_macros = "0.27.1"
2927
clap = { version = "4.5.17", features = ["derive", "env"] }
3028
humantime = "2.1.0"
31-
ratatui = { version = "0.28.1", features = ["all-widgets"] }
29+
ratatui = { version = "0.29.0", features = ["all-widgets"] }
3230
crossterm = "0.28.1"
3331
chrono = "0.4.38"
34-
hf-hub = { version = "0.3.2", features = ["tokio"] }
32+
hf-hub = { version = "0.4.2", features = ["tokio"] }
3533
indicatif = "0.17.8"
3634
rayon = "1.10.0"
3735
serde_with = "3.9.0"
38-
sysinfo = "0.31.4"
36+
sysinfo = "0.33.1"
3937
mockito = "1.5.0"
4038
tabled = "=0.14"
4139
uuid = { version = "1.11.0", features = ["v4", "fast-rng"] }

src/app.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use ratatui::{
1515
symbols,
1616
symbols::border,
1717
text::{Line, Text},
18-
widgets::{block::Title, Block, Paragraph, Widget},
18+
widgets::{Block, Paragraph, Widget},
1919
DefaultTerminal, Frame,
2020
};
2121
use std::collections::HashMap;
@@ -107,9 +107,9 @@ pub async fn run_console(
107107
timestamp: event.timestamp,
108108
}));
109109
}
110-
BenchmarkEvent::BenchmarkReportEnd => {
110+
BenchmarkEvent::BenchmarkReportEnd(path) => {
111111
dispatcher.lock().expect("lock").dispatch(Action::LogMessage(LogMessageUI {
112-
message: "Benchmark report saved.".to_string(),
112+
message: format!("Benchmark report saved to {}", path),
113113
level: LogLevel::Info,
114114
timestamp: chrono::Utc::now(),
115115
}));
@@ -286,9 +286,9 @@ impl Widget for &App {
286286
.constraints([Constraint::Percentage(35), Constraint::Percentage(65)])
287287
.split(bottom_layout[0]);
288288
// LOGS
289-
let logs_title = Title::from("Logs".bold());
289+
let logs_title = Line::from("Logs".bold()).centered();
290290
let logs_block = Block::bordered()
291-
.title(logs_title.alignment(Alignment::Center))
291+
.title_top(logs_title)
292292
.border_set(border::THICK);
293293
List::new(
294294
state
@@ -339,7 +339,7 @@ impl Widget for &App {
339339
Paragraph::new(config_text.clone()).render(main_layout[0], buf);
340340

341341
// STEPS
342-
let steps_block_title = Title::from("Benchmark steps".bold());
342+
let steps_block_title = Line::from("Benchmark steps".bold()).centered();
343343
let steps_block = Block::bordered()
344344
.title(steps_block_title.alignment(Alignment::Center))
345345
.border_set(border::THICK);
@@ -389,7 +389,7 @@ impl Widget for &App {
389389
.render(steps_graph_layout[0], buf);
390390

391391
// CHARTS
392-
let graphs_block_title = Title::from("Token throughput rate".bold());
392+
let graphs_block_title = Line::from("Token throughput rate".bold()).centered();
393393
let graphs_block = Block::bordered()
394394
.title(graphs_block_title.alignment(Alignment::Center))
395395
.border_set(border::THICK);

src/benchmark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub enum Event {
4040
BenchmarkProgress(BenchmarkEvent),
4141
BenchmarkEnd(BenchmarkEvent),
4242
Message(MessageEvent),
43-
BenchmarkReportEnd,
43+
BenchmarkReportEnd(String),
4444
BenchmarkError(String),
4545
}
4646

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ pub async fn run(mut run_config: RunConfiguration, stop_sender: Sender<()>) -> a
192192
let writer=BenchmarkReportWriter::try_new(config.clone(), report)?;
193193
writer.json(path).await?;
194194
info!("Report saved to {:?}",path);
195+
let _ = tx.send(Event::BenchmarkReportEnd(format!("{:?}", path)));
195196
},
196197
Err(e) => {
197198
error!("Error running benchmark: {:?}", e.to_string());
@@ -203,7 +204,6 @@ pub async fn run(mut run_config: RunConfiguration, stop_sender: Sender<()>) -> a
203204
debug!("Received stop signal, stopping benchmark");
204205
}
205206
}
206-
let _ = tx.send(Event::BenchmarkReportEnd);
207207
info!("Benchmark finished");
208208
if !run_config.interactive {
209209
// quit app if not interactive

src/requests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ impl ConversationTextRequestGenerator {
423423
Arc::from(Mutex::from(HashMap::new()));
424424
info!(
425425
"Generating requests from {filepath}",
426-
filepath = filepath.display().to_string()
426+
filepath = filepath.display()
427427
);
428428
let bar = ProgressBar::new(data.len() as u64);
429429
bar.set_style(ProgressStyle::with_template(
@@ -556,7 +556,7 @@ impl ConversationTextRequestGenerator {
556556

557557
fn sample_num_tokens(num_tokens: u64, min_tokens: u64, max_tokens: u64, variance: u64) -> u64 {
558558
let normal = rand_distr::Normal::new(num_tokens as f64, variance as f64).unwrap();
559-
let mut num_tokens = normal.sample(&mut rand::thread_rng()) as u64;
559+
let mut num_tokens = normal.sample(&mut rand::rng()) as u64;
560560
if num_tokens < min_tokens {
561561
num_tokens = min_tokens;
562562
}

src/writers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub struct SystemInfo {
9696
impl SystemInfo {
9797
pub fn new() -> SystemInfo {
9898
let s = System::new_with_specifics(
99-
sysinfo::RefreshKind::new()
99+
sysinfo::RefreshKind::nothing()
100100
.with_memory(MemoryRefreshKind::everything())
101101
.with_cpu(CpuRefreshKind::everything()),
102102
);

0 commit comments

Comments
 (0)