0
0
Prompt Engineering / GenAIml~10 mins

Emerging trends (smaller models, edge AI) in Prompt Engineering / GenAI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a smaller AI model for edge devices.

Prompt Engineering / GenAI
model = SmallModel(input_size=128, output_size=10, [1]=2)
Drag options to blanks, or click blank then click option'
Alayers
Bepochs
Cbatch_size
Dlearning_rate
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing training parameters like epochs or batch size with model architecture.
2fill in blank
medium

Complete the code to quantize the model for efficient edge deployment.

Prompt Engineering / GenAI
quantized_model = quantize(model, [1]='int8')
Drag options to blanks, or click blank then click option'
Aprecision
Bformat
Ctype
Dmode
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'format' or 'type' which are not the correct parameter names here.
3fill in blank
hard

Fix the error in the code to deploy the model on an edge device.

Prompt Engineering / GenAI
device = get_device('[1]')
model.to(device)
Drag options to blanks, or click blank then click option'
Agpu
Bcpu
Ctpu
Dedge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'gpu' or 'tpu' which are not commonly available on edge devices.
4fill in blank
hard

Fill both blanks to create a dictionary of model sizes and their latency on edge devices.

Prompt Engineering / GenAI
results = { [1]: [2] for [1], [2] in zip(sizes, latencies) }
Drag options to blanks, or click blank then click option'
Asize
Blatency
Csizes
Dlatencies
Attempts:
3 left
💡 Hint
Common Mistakes
Using plural variable names as keys or values, which causes errors.
5fill in blank
hard

Fill all three blanks to filter models smaller than 10MB and with latency under 50ms.

Prompt Engineering / GenAI
filtered = { [1]: [2] for [1], [2] in models.items() if [3] < 10 and [2] < 50 }
Drag options to blanks, or click blank then click option'
Amodel_name
Bsize
Dlatency
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up keys and values or using wrong variable names in the condition.