ragtime 0.2.0

Easy Retrieval Augmented Generation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::prompt::Phi3Prompt;
use crate::llama::{Llama, LlamaQaModel};
use llama_cpp_2::{model::LlamaModel, token::LlamaToken};

#[derive(Default)]
pub struct Phi3Model;

impl LlamaQaModel for Phi3Model {
    type Prompt = Phi3Prompt;

    fn is_finished(&mut self, model: &LlamaModel, token: LlamaToken) -> bool {
        token == model.token_eos() || token.0 == 32007
    }
}

pub type Phi3 = Llama<Phi3Model>;