export llama_timings as struct and expose them in server
This commit is contained in:
parent
c19daa4eb5
commit
efa86bf2a6
7 changed files with 1170 additions and 1001 deletions
|
@ -5,6 +5,8 @@ const paramDefaults = {
|
|||
stop: ["</s>"]
|
||||
};
|
||||
|
||||
let generation_settings = null;
|
||||
|
||||
/**
|
||||
* This function completes the input text using a llama dictionary.
|
||||
* @param {object} params - The parameters for the completion request.
|
||||
|
@ -66,6 +68,9 @@ export const llamaComplete = async (params, controller, callback) => {
|
|||
|
||||
// if we got a stop token from server, we will break here
|
||||
if (result.data.stop) {
|
||||
if(result.data.generation_settings) {
|
||||
generation_settings = result.data.generation_settings;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -79,3 +84,11 @@ export const llamaComplete = async (params, controller, callback) => {
|
|||
|
||||
return content;
|
||||
}
|
||||
|
||||
export const llamaModelInfo = async () => {
|
||||
if (!generation_settings) {
|
||||
generation_settings = await fetch("/model.json").then(r => r.json());
|
||||
}
|
||||
return generation_settings;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue