Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove or add a way to disable println!("count {}", reverse_count); #28

Open
alescdb opened this issue Jan 3, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@alescdb
Copy link

alescdb commented Jan 3, 2024

First, thanks for your work :)

I'm trying to silence llama.cpp output and keep only the answer.
I've closed stderr temporally while loading the model (this is not a nice approach, but it works).

unsafe {
    libc::close(libc::STDERR_FILENO);
}

let llama = LLama::new(model,&options);

unsafe {
    let wr = "w".as_ptr() as *const c_char;
    let fd = libc::fdopen(libc::STDERR_FILENO, wr);
    libc::dup2(fd as i32, libc::STDERR_FILENO);
}

But when I call predict I still have an unwanted output count 0.
Maybe you can change it to log::debug!("count {}", reverse_count); ?

@mdrokz mdrokz added bugfix bug Something isn't working and removed bugfix labels Jan 6, 2024
@mdrokz
Copy link
Owner

mdrokz commented Jan 6, 2024

First, thanks for your work :)

I'm trying to silence llama.cpp output and keep only the answer. I've closed stderr temporally while loading the model (this is not a nice approach, but it works).

unsafe {
    libc::close(libc::STDERR_FILENO);
}

let llama = LLama::new(model,&options);

unsafe {
    let wr = "w".as_ptr() as *const c_char;
    let fd = libc::fdopen(libc::STDERR_FILENO, wr);
    libc::dup2(fd as i32, libc::STDERR_FILENO);
}

But when I call predict I still have an unwanted output count 0. Maybe you can change it to log::debug!("count {}", reverse_count); ?

I will add logging instead of println! that will be better thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants