Skip to content

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

Open

Description

@alescdb

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); ?

Activity

  1. added
    bugSomething isn't working
    and removed on Jan 6, 2024
  2. mdrokz commented on Jan 6, 2024

    @mdrokz
    Owner

    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!

  3. added a commit that references this issue on Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions