{ "id": "inference", "concept": "Inference & Pipelines", "fiction": "The knight learns to call a soul into a vessel, waking dormant models and commanding them to cast their logic upon the world.", "questions": [ { "id": "inf_q1", "shown": { "question": "Explain what 'inference' means in the context of machine learning models.", "concept_brief": "Ask the knight to explain what the spirit does once it is awake and answering questions, rather than learning." }, "check": { "strategy": "llm_judge", "spec": { "rubric": [ "Mentions making predictions or generating outputs", "Mentions using an already trained model" ] } }, "reveal": "Inference is the process of using a trained model to make predictions or generate outputs on new data." }, { "id": "inf_q2", "shown": { "question": "What is the name of the high-level `transformers` function that combines a tokenizer and a model to easily perform tasks without writing boilerplate code?", "concept_brief": "What is the name of the grand conduit that combines both the Runesmith's tool and the spirit's vessel into one swift spell?" }, "check": { "strategy": "keyword", "spec": { "correct_any": [ "pipeline", "pipeline()" ] } }, "reveal": "The `pipeline` function." }, { "id": "inf_q3", "shown": { "question": "Which specific class in the `transformers` library is used to automatically load language models that generate text step-by-step?", "concept_brief": "What specific vessel is forged for a spirit that speaks word by word, foretelling the next?" }, "check": { "strategy": "keyword", "spec": { "correct_any": [ "automodelforcausallm", "AutoModelForCausalLM" ] } }, "reveal": "The `AutoModelForCausalLM` class." }, { "id": "inf_q4", "shown": { "question": "Write one line of Python code to load the \"gpt2\" model using the standard method of the `AutoModel` class.", "concept_brief": "The knight must utter the exact incantation to pull the spirit 'gpt2' into a general vessel." }, "check": { "strategy": "ast", "spec": { "must_call_any": [ "from_pretrained" ] } }, "reveal": "AutoModel.from_pretrained(\"gpt2\")" }, { "id": "inf_q5", "shown": { "question": "Write one line of Python code to make a loaded language `model` produce new text based on input tensors, using the standard generation method.", "concept_brief": "Command the vessel to speak, bringing forth new runes from the seed it was given." }, "check": { "strategy": "ast", "spec": { "must_call_any": [ "generate" ] } }, "reveal": "model.generate(**inputs)" }, { "id": "inf_q6", "shown": { "question": "While Hugging Face supports multiple deep learning frameworks, which one is most commonly used by default for model weights on the Hub?", "concept_brief": "What is the foundational deep magic, the primary language of power, that most vessels are forged in?" }, "check": { "strategy": "keyword", "spec": { "correct_any": [ "pytorch", "torch" ] } }, "reveal": "PyTorch." }, { "id": "inf_q7", "shown": { "question": "In PyTorch, what method is used to move a loaded model to a specific hardware accelerator, like a GPU?", "concept_brief": "By what command does the knight physically shift the vessel onto the grand altar of computation?" }, "check": { "strategy": "keyword", "spec": { "correct_any": [ ".to", "to()", "cuda()" ] } }, "reveal": "The `.to()` method (e.g., `model.to(\"cuda\")`)." }, { "id": "inf_q8", "shown": { "question": "Running massive models requires a vast amount of what specific hardware memory resource, usually found on GPUs?", "concept_brief": "The great vessels require vast arenas of computation to awake. What is this specific heavy resource called?" }, "check": { "strategy": "keyword", "spec": { "correct_any": [ "vram", "gpu memory" ] } }, "reveal": "VRAM (Video RAM)." }, { "id": "inf_q9", "shown": { "question": "In the `diffusers` library, what is the core class used to load pre-trained image generation models, similar to how AutoModel works for text?", "concept_brief": "What is the grand conduit used specifically by the painters' guild to bring a visual spirit to life?" }, "check": { "strategy": "keyword", "spec": { "correct_any": [ "diffusionpipeline", "DiffusionPipeline", "stablediffusionpipeline" ] } }, "reveal": "The `DiffusionPipeline` class." }, { "id": "inf_q10", "shown": { "question": "What object or file defines the specific architecture of a model, such as its number of layers and hidden size?", "concept_brief": "What is the blueprint that dictates exactly how the vessel is shaped and how many chambers it has?" }, "check": { "strategy": "keyword", "spec": { "correct_any": [ "config", "configuration", "config.json" ] } }, "reveal": "The configuration (or `config.json`)." } ] }