Spaces:
Running
on
A10G
Running
on
A10G
Oleg Shulyakov
commited on
Commit
·
efd9339
1
Parent(s):
881df40
Fix train_data_file usage
Browse files
app.py
CHANGED
|
@@ -21,6 +21,7 @@ class QuantizationConfig:
|
|
| 21 |
method: str
|
| 22 |
use_imatrix: bool = False
|
| 23 |
imatrix_method: str = "IQ4_NL"
|
|
|
|
| 24 |
quant_embedding: bool = False
|
| 25 |
embedding_tensor_method: str = "Q8_0"
|
| 26 |
leave_output: bool = False
|
|
@@ -149,7 +150,11 @@ class HuggingFaceModelProcessor:
|
|
| 149 |
if not os.path.isfile(quant_config.fp16_model):
|
| 150 |
raise GGUFConverterError(f"Model file not found: {quant_config.fp16_model}")
|
| 151 |
|
| 152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
if not os.path.isfile(train_data_path):
|
| 154 |
raise GGUFConverterError(f"Training data file not found: {train_data_path}")
|
| 155 |
|
|
@@ -798,6 +803,7 @@ class GGUFConverterUI:
|
|
| 798 |
method=q_method,
|
| 799 |
use_imatrix=use_imatrix,
|
| 800 |
imatrix_method=imatrix_q_method,
|
|
|
|
| 801 |
quant_embedding=quant_embedding,
|
| 802 |
embedding_tensor_method=embedding_tensor_method,
|
| 803 |
leave_output=leave_output,
|
|
|
|
| 21 |
method: str
|
| 22 |
use_imatrix: bool = False
|
| 23 |
imatrix_method: str = "IQ4_NL"
|
| 24 |
+
train_data: str = ""
|
| 25 |
quant_embedding: bool = False
|
| 26 |
embedding_tensor_method: str = "Q8_0"
|
| 27 |
leave_output: bool = False
|
|
|
|
| 150 |
if not os.path.isfile(quant_config.fp16_model):
|
| 151 |
raise GGUFConverterError(f"Model file not found: {quant_config.fp16_model}")
|
| 152 |
|
| 153 |
+
if quant_config.train_data:
|
| 154 |
+
train_data_path = quant_config.train_data
|
| 155 |
+
else:
|
| 156 |
+
train_data_path = self.CALIBRATION_FILE
|
| 157 |
+
|
| 158 |
if not os.path.isfile(train_data_path):
|
| 159 |
raise GGUFConverterError(f"Training data file not found: {train_data_path}")
|
| 160 |
|
|
|
|
| 803 |
method=q_method,
|
| 804 |
use_imatrix=use_imatrix,
|
| 805 |
imatrix_method=imatrix_q_method,
|
| 806 |
+
train_data=train_data_file.name,
|
| 807 |
quant_embedding=quant_embedding,
|
| 808 |
embedding_tensor_method=embedding_tensor_method,
|
| 809 |
leave_output=leave_output,
|