mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-07-30 15:40:31 -07:00
feat: add training time estimates and device selection to PassGPT menu
Show estimated training times for CUDA/MPS/CPU before starting a training run. Add device selection prompt with cuda as the default. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e1d6922edc
commit
16860a51d0
@@ -258,8 +258,8 @@ class TestPassGPTAttackHandler:
|
||||
ctx.select_file_with_autocomplete.return_value = "/tmp/wordlist.txt"
|
||||
ctx.hcatPassGPTTrain.return_value = "/home/user/.hate_crack/passgpt/wordlist"
|
||||
|
||||
# "T" for train, "" for default base model, "" for default max candidates
|
||||
inputs = iter(["T", "", ""])
|
||||
# "T" for train, "" for default base model, "" for default device (cuda), "" for default max candidates
|
||||
inputs = iter(["T", "", "", ""])
|
||||
with (
|
||||
patch("builtins.input", side_effect=inputs),
|
||||
patch("hate_crack.attacks.os.path.isdir", return_value=False),
|
||||
@@ -269,7 +269,7 @@ class TestPassGPTAttackHandler:
|
||||
passgpt_attack(ctx)
|
||||
|
||||
ctx.hcatPassGPTTrain.assert_called_once_with(
|
||||
"/tmp/wordlist.txt", "javirandor/passgpt-10characters"
|
||||
"/tmp/wordlist.txt", "javirandor/passgpt-10characters", device="cuda"
|
||||
)
|
||||
ctx.hcatPassGPT.assert_called_once()
|
||||
call_kwargs = ctx.hcatPassGPT.call_args
|
||||
@@ -280,7 +280,8 @@ class TestPassGPTAttackHandler:
|
||||
ctx.select_file_with_autocomplete.return_value = "/tmp/wordlist.txt"
|
||||
ctx.hcatPassGPTTrain.return_value = None
|
||||
|
||||
inputs = iter(["T", ""])
|
||||
# "T" for train, "" for default base model, "" for default device (cuda)
|
||||
inputs = iter(["T", "", ""])
|
||||
with (
|
||||
patch("builtins.input", side_effect=inputs),
|
||||
patch("hate_crack.attacks.os.path.isdir", return_value=False),
|
||||
|
||||
Reference in New Issue
Block a user