Skip to content

Latest commit

 

History

History
193 lines (191 loc) · 4.9 KB

File metadata and controls

193 lines (191 loc) · 4.9 KB

Results of GPT-3.5 on HumanEval/15

Date: 18 July, 2023
Model: gpt-3.5-turbo
Temperature: 0.2
Passing runs: 10
Total runs: 10
Success rate: 100%

Prompt

Tokens: 94

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """

The above is an incomplete Python code fragment. Return the complete and correct code with no additional text.

Correct solution

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """return ' '.join([str(x) for x in range(n + 1)])

Unit tests

METADATA = {
    'author': 'jt',
    'dataset': 'test'
}


def check(candidate):
    assert candidate(0) == '0'
    assert candidate(3) == '0 1 2 3'
    assert candidate(10) == '0 1 2 3 4 5 6 7 8 9 10'

Runs

✅ Run 1

Start time: 2023-07-18 17:27:55
Duration: 3.17s
Completion tokens: 78
Result: Pass

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """
    return ' '.join(str(i) for i in range(n+1))

✅ Run 2

Start time: 2023-07-18 17:27:51
Duration: 3.49s
Completion tokens: 78
Result: Pass

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """
    return ' '.join(str(i) for i in range(n+1))

✅ Run 3

Start time: 2023-07-18 17:27:48
Duration: 3.49s
Completion tokens: 78
Result: Pass

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """
    return ' '.join(str(i) for i in range(n+1))

✅ Run 4

Start time: 2023-07-18 17:27:44
Duration: 3.35s
Completion tokens: 78
Result: Pass

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """
    return ' '.join(str(i) for i in range(n+1))

✅ Run 5

Start time: 2023-07-18 17:27:41
Duration: 3.44s
Completion tokens: 78
Result: Pass

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """
    return ' '.join(str(i) for i in range(n+1))

✅ Run 6

Start time: 2023-07-18 17:27:37
Duration: 3.13s
Completion tokens: 78
Result: Pass

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """
    return ' '.join(str(i) for i in range(n+1))

✅ Run 7

Start time: 2023-07-18 17:27:34
Duration: 3.34s
Completion tokens: 78
Result: Pass

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """
    return ' '.join(str(i) for i in range(n+1))

✅ Run 8

Start time: 2023-07-18 17:27:30
Duration: 3.52s
Completion tokens: 78
Result: Pass

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """
    return ' '.join(str(i) for i in range(n+1))

✅ Run 9

Start time: 2023-07-18 17:27:28
Duration: 2.69s
Completion tokens: 78
Result: Pass

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """
    return ' '.join(str(i) for i in range(n+1))

✅ Run 10

Start time: 2023-07-18 17:27:24
Duration: 3.41s
Completion tokens: 78
Result: Pass

def string_sequence(n: int) -> str:
    """ Return a string containing space-delimited numbers starting from 0 upto n inclusive.
    >>> string_sequence(0)
    '0'
    >>> string_sequence(5)
    '0 1 2 3 4 5'
    """
    return ' '.join(str(i) for i in range(n+1))