mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-31 08:51:55 +00:00 
			
		
		
		
	export llama_timings as struct and expose them in server
This commit is contained in:
		| @@ -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; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Tobias Lütke
					Tobias Lütke