mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-07-30 15:40:31 -07:00
fix: auto-detect training device instead of defaulting to CUDA
The PassGPT training device menu now uses _detect_device() to default to the best available device (CUDA > MPS > CPU) rather than always defaulting to CUDA, which fails on systems without NVIDIA GPUs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
0a80ac6d22
commit
14f5b36382
@@ -261,11 +261,14 @@ 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 device (cuda), "" for default max candidates
|
||||
# "T" for train, "" for default base model, "" for default device (auto-detected), "" for default max candidates
|
||||
inputs = iter(["T", "", "", ""])
|
||||
with (
|
||||
patch("builtins.input", side_effect=inputs),
|
||||
patch("hate_crack.attacks.os.path.isdir", return_value=False),
|
||||
patch(
|
||||
"hate_crack.passgpt_train._detect_device", return_value="cuda"
|
||||
),
|
||||
):
|
||||
from hate_crack.attacks import passgpt_attack
|
||||
|
||||
@@ -283,11 +286,14 @@ class TestPassGPTAttackHandler:
|
||||
ctx.select_file_with_autocomplete.return_value = "/tmp/wordlist.txt"
|
||||
ctx.hcatPassGPTTrain.return_value = None
|
||||
|
||||
# "T" for train, "" for default base model, "" for default device (cuda)
|
||||
# "T" for train, "" for default base model, "" for default device (auto-detected)
|
||||
inputs = iter(["T", "", ""])
|
||||
with (
|
||||
patch("builtins.input", side_effect=inputs),
|
||||
patch("hate_crack.attacks.os.path.isdir", return_value=False),
|
||||
patch(
|
||||
"hate_crack.passgpt_train._detect_device", return_value="cuda"
|
||||
),
|
||||
):
|
||||
from hate_crack.attacks import passgpt_attack
|
||||
|
||||
|
||||
Reference in New Issue
Block a user