-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aisuko <[email protected]>
- Loading branch information
Showing
4 changed files
with
159 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
use bunker::pb::{ModelOptions, PredictOptions}; | ||
|
||
pub(crate) mod mnist; | ||
pub use mnist::mnist::MNINST; | ||
|
||
use bunker::pb::{ModelOptions, PredictOptions}; | ||
|
||
/// Trait for implementing a Language Model. | ||
pub trait LLM { | ||
/// Loads the model from the given options. | ||
fn load_model(&mut self, request: ModelOptions) -> Result<String, Box<dyn std::error::Error>>; | ||
/// Predicts the output for the given input options. | ||
fn predict(&mut self, request: PredictOptions) -> Result<String, Box<dyn std::error::Error>>; | ||
} | ||
|
||
pub struct LLModel { | ||
model: Box<dyn LLM + 'static>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters