Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Make some types Debug/Clone/Copy #113

Merged
merged 1 commit into from
Apr 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion llama-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ impl Default for InferenceParameters {
}

/// Statistics about the inference process.
#[derive(Debug, Clone, Copy)]
pub struct InferenceStats {
/// How long it took to feed the prompt.
pub feed_prompt_duration: std::time::Duration,
Expand Down Expand Up @@ -291,6 +292,7 @@ type Token = String;
type TokenScore = f32;

/// The vocabulary used by a model.
#[derive(Debug, Clone)]
pub struct Vocabulary {
/// Maps every integer (index) token id to its corresponding token
id_to_token: Vec<Token>,
Expand Down Expand Up @@ -545,7 +547,7 @@ pub enum InferenceError {
}

/// Used in a call to `evaluate` to request information from the transformer.
#[derive(Default)]
#[derive(Default, Debug, Clone)]
pub struct EvaluateOutputRequest {
/// Returns all the logits for the provided batch of tokens.
/// Output shape is n_batch * n_vocab
Expand Down