Skip to content
DeepForgeby svx
All problems
EasyDeep Learningdl-102

Latency Estimate

Problem

Estimate per-token latency in milliseconds: total_ms / num_tokens.

The signature is latency_ms_per_token(total_ms, num_tokens).

Hint

Per-token latency is what matters for streaming generation.

Test cases

case 1
in: [100,50]
expected: 2
case 2
in: [1,8]
expected: 0.125
case 3
in: [250,1000]
expected: 0.25
case 4
in: [5,4]
expected: 1.25
Starter codePython
def latency_ms_per_token(total_ms, num_tokens):
    # Your code here
    pass

4 test cases · run your code against them in the editor