mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-31 08:51:55 +00:00 
			
		
		
		
	gguf.py : add layer norm eps and merges
This commit is contained in:
		
							
								
								
									
										11
									
								
								gguf.py
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								gguf.py
									
									
									
									
									
								
							| @@ -260,6 +260,14 @@ class GGUFWriter: | |||||||
|         self.write_float32( |         self.write_float32( | ||||||
|             constants.KEY_ATTENTION_CLAMP_KQV.format(llm=llm), value) |             constants.KEY_ATTENTION_CLAMP_KQV.format(llm=llm), value) | ||||||
|  |  | ||||||
|  |     def write_layer_norm_eps(self, llm: str, value: float): | ||||||
|  |         self.write_float32( | ||||||
|  |             constants.KEY_ATTENTION_LAYERNORM_EPS.format(llm=llm), value) | ||||||
|  |  | ||||||
|  |     def write_layer_norm_rms_eps(self, llm: str, value: float): | ||||||
|  |         self.write_float32( | ||||||
|  |             constants.KEY_ATTENTION_LAYERNORM_RMS_EPS.format(llm=llm), value) | ||||||
|  |  | ||||||
|     def write_rope_dimension_count(self, llm: str, count: int): |     def write_rope_dimension_count(self, llm: str, count: int): | ||||||
|         self.write_uint32( |         self.write_uint32( | ||||||
|             constants.KEY_ROPE_DIMENSION_COUNT.format(llm=llm), count) |             constants.KEY_ROPE_DIMENSION_COUNT.format(llm=llm), count) | ||||||
| @@ -273,6 +281,9 @@ class GGUFWriter: | |||||||
|     def write_token_list(self, tokens: List): |     def write_token_list(self, tokens: List): | ||||||
|         self.write_array(constants.KEY_TOKENIZER_LIST, tokens) |         self.write_array(constants.KEY_TOKENIZER_LIST, tokens) | ||||||
|  |  | ||||||
|  |     def write_token_merges(self, merges: List): | ||||||
|  |         self.write_array(constants.KEY_TOKENIZER_MERGES, merges) | ||||||
|  |  | ||||||
|     def write_token_scores(self, scores: List[float]): |     def write_token_scores(self, scores: List[float]): | ||||||
|         self.write_array(constants.KEY_TOKENIZER_SCORES, scores) |         self.write_array(constants.KEY_TOKENIZER_SCORES, scores) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 klosax
					klosax