Spaces:
Paused
Paused
rodrigomasini
commited on
Commit
•
6a1c808
1
Parent(s):
5f5b726
Update app_v2.py
Browse files
app_v2.py
CHANGED
@@ -6,7 +6,9 @@ import os
|
|
6 |
|
7 |
# Define pretrained and quantized model directories
|
8 |
pretrained_model_dir = "FPHam/Jackson_The_Formalizer_V2_13b_GPTQ"
|
9 |
-
|
|
|
|
|
10 |
|
11 |
# Create the cache directory if it doesn't exist
|
12 |
os.makedirs(quantized_model_dir, exist_ok=True)
|
@@ -14,7 +16,7 @@ os.makedirs(quantized_model_dir, exist_ok=True)
|
|
14 |
snapshot_download(repo_id=pretrained_model_dir, local_dir=quantized_model_dir, local_dir_use_symlinks=False)
|
15 |
|
16 |
# Quantization configuration
|
17 |
-
quantize_config = BaseQuantizeConfig(bits=4, group_size=128, damp_percent=0.01, desc_act=False)
|
18 |
|
19 |
# Load the model using from_quantized
|
20 |
model = AutoGPTQForCausalLM.from_quantized(
|
@@ -22,9 +24,9 @@ model = AutoGPTQForCausalLM.from_quantized(
|
|
22 |
use_safetensors=True,
|
23 |
strict=False,
|
24 |
device="cuda:0",
|
25 |
-
trust_remote_code=True,
|
26 |
use_triton=False,
|
27 |
-
quantize_config=quantize_config
|
28 |
)
|
29 |
|
30 |
#model.save_quantized(quantized_model_dir)
|
|
|
6 |
|
7 |
# Define pretrained and quantized model directories
|
8 |
pretrained_model_dir = "FPHam/Jackson_The_Formalizer_V2_13b_GPTQ"
|
9 |
+
cwd = os.getcwd()
|
10 |
+
|
11 |
+
quantized_model_dir = cwd + "/Jackson2-4bit-128g-GPTQ"
|
12 |
|
13 |
# Create the cache directory if it doesn't exist
|
14 |
os.makedirs(quantized_model_dir, exist_ok=True)
|
|
|
16 |
snapshot_download(repo_id=pretrained_model_dir, local_dir=quantized_model_dir, local_dir_use_symlinks=False)
|
17 |
|
18 |
# Quantization configuration
|
19 |
+
# quantize_config = BaseQuantizeConfig(bits=4, group_size=128, damp_percent=0.01, desc_act=False)
|
20 |
|
21 |
# Load the model using from_quantized
|
22 |
model = AutoGPTQForCausalLM.from_quantized(
|
|
|
24 |
use_safetensors=True,
|
25 |
strict=False,
|
26 |
device="cuda:0",
|
27 |
+
#trust_remote_code=True,
|
28 |
use_triton=False,
|
29 |
+
#quantize_config=quantize_config
|
30 |
)
|
31 |
|
32 |
#model.save_quantized(quantized_model_dir)
|