{"record":{"id":"e9194314c407e054","repo":"deepseek-ai/DeepSeek-V3","slug":"either-input-file-or-interactive-mode-must-be-spec","errorCode":null,"errorMessage":"Either input-file or interactive mode must be specified","messagePattern":"Either input-file or interactive mode must be specified","errorType":"validation","errorClass":"AssertionError","httpStatus":null,"severity":"error","filePath":"inference/generate.py","lineNumber":184,"sourceCode":"        --ckpt-path (str): Path to the model checkpoint directory.\n        --config (str): Path to the model configuration file.\n        --input-file (str, optional): File containing prompts for batch processing.\n        --interactive (bool, optional): Enable interactive mode for generating text.\n        --max-new-tokens (int, optional): Maximum number of new tokens to generate. Defaults to 200.\n        --temperature (float, optional): Temperature for sampling. Defaults to 0.2.\n\n    Raises:\n        AssertionError: If neither input-file nor interactive mode is specified.\n    \"\"\"\n    parser = ArgumentParser()\n    parser.add_argument(\"--ckpt-path\", type=str, required=True)\n    parser.add_argument(\"--config\", type=str, required=True)\n    parser.add_argument(\"--input-file\", type=str, default=\"\")\n    parser.add_argument(\"--interactive\", action=\"store_true\")\n    parser.add_argument(\"--max-new-tokens\", type=int, default=200)\n    parser.add_argument(\"--temperature\", type=float, default=0.2)\n    args = parser.parse_args()\n    assert args.input_file or args.interactive, \"Either input-file or interactive mode must be specified\"\n    main(args.ckpt_path, args.config, args.input_file, args.interactive, args.max_new_tokens, args.temperature)\n","sourceCodeStart":166,"sourceCodeEnd":186,"githubUrl":"https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/generate.py#L166-L186","documentation":"Thrown in __main__ of inference/generate.py:184: the script requires exactly one input mode — either --input-file PATH (batched completions) or --interactive (REPL chat). With neither, there is nothing to generate from, so the assert aborts before main() runs. The mode also decides whether the script builds a chat loop or a one-shot batch.","triggerScenarios":"Running generate.py --ckpt-path ... --config ... with neither --interactive nor a non-empty --input-file. Note --input-file defaults to \"\", so an omitted or empty string counts as absent.","commonSituations":"Copy-pasting a launch command from docs that omitted the mode flag; passing --input-file without a value so argparse consumes the next flag; passing an empty-string path explicitly.","solutions":["Add --interactive for chat mode: python generate.py --ckpt-path ... --config ... --interactive","Or provide a prompt file: --input-file prompts.txt (one prompt per line, count must fit max_batch_size — see error 5)","Double-check that --input-file actually has a value if you intended batch mode"],"exampleFix":"# before\npython generate.py --ckpt-path ckpt/ --config config.json  # AssertionError\n\n# after — interactive chat\npython generate.py --ckpt-path ckpt/ --config config.json --interactive\n\n# after — batch file\npython generate.py --ckpt-path ckpt/ --config config.json --input-file prompts.txt","handlingStrategy":"validation","validationCode":"import sys\nif not (\"--interactive\" in sys.argv or any(a == \"--input-file\" for a in sys.argv) or \"--input-file=\" in \" \".join(sys.argv)):\n    sys.exit(\"error: pass --interactive or --input-file PATH\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include exactly one of --interactive / --input-file in launch commands","Pin your launch command in a script or README so copy-paste is complete"],"tags":["cli","argument-validation","usage-error","deepseek"],"backgroundTag":null,"analyzedSha":"9b4e9788e4a3a731f7567338ed15d3ec549ce03b","analyzedAt":"2026-08-14T19:02:32.748Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}