Update modeling_chatglm.py
#94
by
Sofianesun
- opened
- modeling_chatglm.py +2 -2
modeling_chatglm.py
CHANGED
|
@@ -1417,7 +1417,7 @@ class ChatGLMForConditionalGeneration(ChatGLMPreTrainedModel):
|
|
| 1417 |
break
|
| 1418 |
yield input_ids
|
| 1419 |
|
| 1420 |
-
def quantize(self, bits: int, empty_init=False, **kwargs):
|
| 1421 |
if bits == 0:
|
| 1422 |
return
|
| 1423 |
|
|
@@ -1431,5 +1431,5 @@ class ChatGLMForConditionalGeneration(ChatGLMPreTrainedModel):
|
|
| 1431 |
|
| 1432 |
self.config.quantization_bit = bits
|
| 1433 |
|
| 1434 |
-
self.transformer = quantize(self.transformer, bits, empty_init=empty_init, **kwargs)
|
| 1435 |
return self
|
|
|
|
| 1417 |
break
|
| 1418 |
yield input_ids
|
| 1419 |
|
| 1420 |
+
def quantize(self, bits: int, empty_init=False, **kwargs): # 量化
|
| 1421 |
if bits == 0:
|
| 1422 |
return
|
| 1423 |
|
|
|
|
| 1431 |
|
| 1432 |
self.config.quantization_bit = bits
|
| 1433 |
|
| 1434 |
+
self.transformer = quantize(self.transformer, bits, empty_init=empty_init, **kwargs)
|
| 1435 |
return self
|