Fix analyze page model selection logic

- Model selection now only shows when there are 2+ video-capable models
- When only 1 model is available, no model selection is shown (uses it automatically)
- Removed the fallback text input that was showing inappropriately
parent e564eaa2
......@@ -242,10 +242,6 @@
{% endfor %}
</select>
</div>
{% else %}
<div class="form-group">
<label>Model Path: <input type="text" name="model_path" value="Qwen/Qwen2.5-VL-7B-Instruct"></label>
</div>
{% endif %}
<div class="form-group">
......
......@@ -254,7 +254,16 @@ def analyze():
flash('Insufficient tokens. Please purchase more tokens.', 'error')
return redirect(url_for('dashboard'))
model_path = request.form.get('model_path', 'Qwen/Qwen2.5-VL-7B-Instruct')
# Determine model path based on available models
if video_models and len(video_models) == 1:
# Use the single available model
model_path = video_models[0]['path']
elif video_models and len(video_models) > 1:
# Use selected model from dropdown
model_path = request.form.get('model_path', video_models[0]['path'])
else:
# Fallback to default if no models available
model_path = 'Qwen/Qwen2.5-VL-7B-Instruct'
prompt = request.form.get('prompt', 'Describe this image.')
interval = int(request.form.get('interval', 10))
uploaded_file = request.files.get('file')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment