mirror of
https://github.com/1SecondEveryday/image-analysis-eval.git
synced 2026-03-25 09:05:49 +00:00
Replace --single-prompt with --skip-prompt, but it sucks
This commit is contained in:
parent
6c6d0e86a3
commit
5cff18bb9a
1 changed files with 8 additions and 13 deletions
|
|
@ -32,7 +32,7 @@ class TagExtractor
|
||||||
@verbose = options[:verbose] || false
|
@verbose = options[:verbose] || false
|
||||||
@max_images = options[:max_images] || nil
|
@max_images = options[:max_images] || nil
|
||||||
@no_unload = options[:no_unload] || false
|
@no_unload = options[:no_unload] || false
|
||||||
@single_prompt = options[:single_prompt] || nil
|
@skip_prompt = options[:skip_prompt] || false
|
||||||
@system_prompt = options[:system_prompt] || DEFAULT_SYSTEM_PROMPT
|
@system_prompt = options[:system_prompt] || DEFAULT_SYSTEM_PROMPT
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ class TagExtractor
|
||||||
|
|
||||||
puts "🚀 Starting tag extraction:"
|
puts "🚀 Starting tag extraction:"
|
||||||
puts " • #{images.length} images found"
|
puts " • #{images.length} images found"
|
||||||
puts " • #{prompts.length} prompts loaded"
|
puts " • #{prompts.length} prompts#{@skip_prompt ? ' (system prompt only)' : ' loaded'}"
|
||||||
puts " • #{@models.length} models to test"
|
puts " • #{@models.length} models to test"
|
||||||
puts
|
puts
|
||||||
|
|
||||||
|
|
@ -180,14 +180,9 @@ class TagExtractor
|
||||||
def load_prompts
|
def load_prompts
|
||||||
prompts = {}
|
prompts = {}
|
||||||
|
|
||||||
if @single_prompt
|
if @skip_prompt
|
||||||
# Load only the specified prompt
|
# Use minimal prompt to rely mainly on system prompt
|
||||||
prompt_file = "prompts/#{@single_prompt}.txt"
|
prompts["no_prompt"] = "Analyze this image."
|
||||||
if File.exist?(prompt_file)
|
|
||||||
prompts[prompt_file] = File.read(prompt_file).strip
|
|
||||||
else
|
|
||||||
puts "❌ Prompt file not found: #{prompt_file}"
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
# Load all prompts
|
# Load all prompts
|
||||||
Dir.glob('prompts/*.txt').each do |file|
|
Dir.glob('prompts/*.txt').each do |file|
|
||||||
|
|
@ -424,7 +419,7 @@ if __FILE__ == $0
|
||||||
verbose: false,
|
verbose: false,
|
||||||
max_images: nil,
|
max_images: nil,
|
||||||
no_unload: false,
|
no_unload: false,
|
||||||
single_prompt: nil
|
skip_prompt: false
|
||||||
}
|
}
|
||||||
|
|
||||||
OptionParser.new do |opts|
|
OptionParser.new do |opts|
|
||||||
|
|
@ -450,8 +445,8 @@ if __FILE__ == $0
|
||||||
options[:no_unload] = true
|
options[:no_unload] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("--single-prompt NAME", "Use only one prompt (e.g. '01-structured-comprehensive')") do |name|
|
opts.on("--skip-prompt", "Skip user prompts and use only system prompt") do
|
||||||
options[:single_prompt] = name
|
options[:skip_prompt] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-h", "--help", "Show this help") do
|
opts.on("-h", "--help", "Show this help") do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue