Skip to content

Commit

Permalink
update checks after quantizing supporting sharded AWQ output
Browse files Browse the repository at this point in the history
  • Loading branch information
suparious authored Sep 19, 2024
1 parent 58468f5 commit 322dd19
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions awq/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,22 @@ def main(author: str, model: str, quanter: str = None, expected_checksum: str =
return

# After quantization
if os.path.exists(os.path.join(awq_model_path, 'model.safetensors')):
model_path = os.path.join(awq_model_path, 'model.safetensors')
sharded_model_index = os.path.join(awq_model_path, 'model.safetensors.index.json')

if os.path.exists(model_path):
logger.info("AWQ model created successfully.")
print("AWQ model created successfully.")
elif os.path.exists(sharded_model_index):
logger.info("AWQ sharded model created successfully.")
print("AWQ sharded model created successfully.")
else:
logger.error("AWQ model creation failed. model.safetensors not found in the output directory.")
print("AWQ model creation failed. model.safetensors not found in the output directory.")
logger.error(
"AWQ model creation failed. Neither 'model.safetensors' nor 'model.safetensors.index.json' found in the output directory."
)
print(
"AWQ model creation failed. Neither 'model.safetensors' nor 'model.safetensors.index.json' found in the output directory."
)
return

# Copy config.json and tokenizer files to AWQ model directory if they don't exist
Expand Down

0 comments on commit 322dd19

Please sign in to comment.