diff --git a/aiworker/run.pl b/aiworker/run.pl index 66df673..091f570 100755 --- a/aiworker/run.pl +++ b/aiworker/run.pl @@ -13,6 +13,7 @@ my $image_count = $ENV{'IMAGE_COUNT'} || 10; # Number of images to extract from my $min_time = $ENV{'MIN_TIME'} || 5; # Minimum time between images my $sensitivity = $ENV{'SENSITIVITY'} || 30; my $resolution = "672:672"; +my $keepalive = $ENV{'KEEP_ALIVE'} || '30m'; #my $model = "hf.co/Jommarn/UNSEEN_Gemma_4_26B_NSFW-GGUF:Q8_0"; my $model = "hf.co/Jommarn/UNSEEN_Gemma_4_26B_NSFW-GGUF:Q5_K_M"; @@ -78,6 +79,7 @@ sub CheckPath { my $ref = { 'model' => $model, 'prompt' => "Are there any african american men in this photo, whether they are shown completely or not? Judge based on skin tone, accounting for shadows. Answer yes for very dark skin.Please answer 'yes' or 'no' only.", + 'keep_alive' => $keepalive, 'images' => [$base64], }; diff --git a/transcoder/transcoder.pl b/transcoder/transcoder.pl index 25c91de..11234f9 100755 --- a/transcoder/transcoder.pl +++ b/transcoder/transcoder.pl @@ -73,8 +73,7 @@ sub get_hash { # --- Compute SHA-256 hash of the file --- return undef unless -f $file_path && -r $file_path; open(my $fh, '<:raw', $file_path) or do { warn "Cannot open $file_path: $!"; return undef; }; - my $hash = sha256_hex($fh); - close($fh); + my $hash = Digest::SHA->new(256)->addfile($fh)->hexdigest; close($fh); return $hash; }