mirror of
https://github.com/huggingface/candle.git
synced 2025-06-18 19:47:12 +00:00
Llama2.c wasm module. (#686)
This commit is contained in:
@ -49,11 +49,11 @@ fn read_tensor<R: std::io::Read, S: Into<Shape>>(
|
||||
Ok(tensor)
|
||||
}
|
||||
|
||||
struct Model {
|
||||
cache: Cache,
|
||||
pub struct Model {
|
||||
pub cache: Cache,
|
||||
config: Config,
|
||||
llama: Llama,
|
||||
tokenizer: Tokenizer,
|
||||
pub llama: Llama,
|
||||
pub tokenizer: Tokenizer,
|
||||
}
|
||||
|
||||
pub struct LogitsProcessor {
|
||||
@ -275,7 +275,7 @@ impl TransformerWeights {
|
||||
}
|
||||
|
||||
impl Model {
|
||||
fn load(md: ModelData) -> Result<Self> {
|
||||
pub fn load(md: ModelData) -> Result<Self> {
|
||||
let dev = Device::Cpu;
|
||||
let mut model = std::io::Cursor::new(md.model);
|
||||
let config = Config::from_reader(&mut model)?;
|
||||
|
Reference in New Issue
Block a user