Broken subprocess command construction in app.py #1

Closed
opened 2026-03-19 17:29:52 +00:00 by llabeyrie · 0 comments
Owner

Description

The subprocess command in app.py (lines 35-40) is fundamentally broken. All CLI flags are concatenated into a single string argument instead of being separate list elements:

cmd = [
    "python prompt_to_card_pipeline.py ",          # trailing space
    prompt_text,
    "--text-cleaner-path text-cleaner/text_cleaning_pipeline.py   --infer-script-path ..."  # single string!
]

Problems

  1. Line 35: "python prompt_to_card_pipeline.py " — trailing space, and python + script should be two separate list elements
  2. Lines 37-38: All flags/arguments crammed into ONE list item as a single string with extra whitespace
  3. The subprocess will receive malformed arguments and always fail

Expected fix

cmd = [
    sys.executable, "prompt_to_card_pipeline.py",
    prompt_text,
    "--text-cleaner-path", "text-cleaner/text_cleaning_pipeline.py",
    "--infer-script-path", "clean-text-to-keywords/infer_json_usage.py",
    "--checkpoint", "pokemon_card_lora",
    "--template", "clean-text-to-keywords/json_template_example.json",
    "--generator-module", "card_generator_adapter.py",
    "--device", "cuda",
    "--save-path", "generated_card.png",
    "--print-json",
]

Impact

The Streamlit app cannot generate any card — every pipeline invocation fails silently.

## Description The subprocess command in `app.py` (lines 35-40) is fundamentally broken. All CLI flags are concatenated into a single string argument instead of being separate list elements: ```python cmd = [ "python prompt_to_card_pipeline.py ", # trailing space prompt_text, "--text-cleaner-path text-cleaner/text_cleaning_pipeline.py --infer-script-path ..." # single string! ] ``` ### Problems 1. **Line 35**: `"python prompt_to_card_pipeline.py "` — trailing space, and `python` + script should be two separate list elements 2. **Lines 37-38**: All flags/arguments crammed into ONE list item as a single string with extra whitespace 3. The subprocess will receive malformed arguments and **always fail** ### Expected fix ```python cmd = [ sys.executable, "prompt_to_card_pipeline.py", prompt_text, "--text-cleaner-path", "text-cleaner/text_cleaning_pipeline.py", "--infer-script-path", "clean-text-to-keywords/infer_json_usage.py", "--checkpoint", "pokemon_card_lora", "--template", "clean-text-to-keywords/json_template_example.json", "--generator-module", "card_generator_adapter.py", "--device", "cuda", "--save-path", "generated_card.png", "--print-json", ] ``` ### Impact **The Streamlit app cannot generate any card** — every pipeline invocation fails silently.
llabeyrie added the bugpriority: critical labels 2026-03-19 17:31:37 +00:00
Sign in to join this conversation.