Skip to content

Commit

Permalink
bump dep + fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
pythops committed Nov 25, 2024
1 parent 5508d69 commit a32e6bf
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 27 deletions.
40 changes: 26 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage = "https://github.com/pythops/tenere"
repository = "https://github.com/pythops/tenere"

[dependencies]
ansi-to-tui = "6"
ansi-to-tui = "7"
arboard = "3"
async-trait = "0.1"
bat = "0.24"
Expand All @@ -22,16 +22,16 @@ reqwest = { version = "0.12", default-features = false, features = [
"json",
"rustls-tls",
] }
ratatui = { version = "0.28", features = ["all-widgets"] }
ratatui = { version = "0.29", features = ["all-widgets"] }
regex = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
strum = "0.26"
strum_macros = "0.26"
tokio = { version = "1", features = ["full"] }
toml = { version = "0.8" }
tui-textarea = "0.6"
unicode-width = "0.1"
tui-textarea = "0.7"
unicode-width = "0.2"

[profile.release]
lto = "fat"
Expand Down
4 changes: 2 additions & 2 deletions src/chatgpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ impl LLM for ChatGPT {
match response.error_for_status() {
Ok(mut res) => {
sender.send(Event::LLMEvent(LLMAnswer::StartAnswer))?;
let re = Regex::new(r"data:\s(.*)")?;

while let Some(chunk) = res.chunk().await? {
let chunk = std::str::from_utf8(&chunk)?;

let re = Regex::new(r"data:\s(.*)")?;

for captures in re.captures_iter(chunk) {
if let Some(data_json) = captures.get(1) {
if terminate_response_signal.load(Ordering::Relaxed) {
Expand Down
3 changes: 1 addition & 2 deletions src/llamacpp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ impl LLM for LLamacpp {
match response.error_for_status() {
Ok(mut res) => {
sender.send(Event::LLMEvent(LLMAnswer::StartAnswer))?;
let re = Regex::new(r"data:\s(.*)")?;
while let Some(chunk) = res.chunk().await? {
let chunk = std::str::from_utf8(&chunk)?;

let re = Regex::new(r"data:\s(.*)")?;

for captures in re.captures_iter(chunk) {
if let Some(data_json) = captures.get(1) {
if terminate_response_signal.load(Ordering::Relaxed) {
Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use tenere::llm::LLMModel;
use std::sync::Arc;
use tokio::sync::Mutex;

use clap::{crate_description, crate_version, Command, Arg};
use clap::{crate_description, crate_version, Arg, Command};

#[tokio::main]
async fn main() -> AppResult<()> {
Expand All @@ -23,10 +23,10 @@ async fn main() -> AppResult<()> {
.version(crate_version!())
.arg(
Arg::new("config")
.short('c')
.long("config")
.help("Path to custom config file")
.value_name("FILE")
.short('c')
.long("config")
.help("Path to custom config file")
.value_name("FILE"),
)
.get_matches();

Expand Down

0 comments on commit a32e6bf

Please sign in to comment.