Skip to content

Latest commit

 

History

History
198 lines (194 loc) · 3.55 KB

File metadata and controls

198 lines (194 loc) · 3.55 KB

Results of GPT-3.5 on HumanEval/53

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

Prompt

Tokens: 79

def add(x: int, y: int):
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """

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

Correct solution

def add(x: int, y: int):
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """return x + y

Unit tests

METADATA = {}


def check(candidate):
    import random

    assert candidate(0, 1) == 1
    assert candidate(1, 0) == 1
    assert candidate(2, 3) == 5
    assert candidate(5, 7) == 12
    assert candidate(7, 5) == 12

    for i in range(100):
        x, y = random.randint(0, 1000), random.randint(0, 1000)
        assert candidate(x, y) == x + y

Runs

✅ Run 1

Start time: 2023-07-18 17:19:48
Duration: 2.79s
Completion tokens: 60
Result: Pass

def add(x: int, y: int) -> int:
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """
    return x + y

✅ Run 2

Start time: 2023-07-18 17:19:45
Duration: 3.22s
Completion tokens: 60
Result: Pass

def add(x: int, y: int) -> int:
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """
    return x + y

✅ Run 3

Start time: 2023-07-18 17:19:42
Duration: 2.67s
Completion tokens: 60
Result: Pass

def add(x: int, y: int) -> int:
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """
    return x + y

✅ Run 4

Start time: 2023-07-18 17:19:40
Duration: 2.76s
Completion tokens: 60
Result: Pass

def add(x: int, y: int) -> int:
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """
    return x + y

✅ Run 5

Start time: 2023-07-18 17:19:37
Duration: 2.63s
Completion tokens: 60
Result: Pass

def add(x: int, y: int) -> int:
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """
    return x + y

✅ Run 6

Start time: 2023-07-18 17:19:34
Duration: 2.44s
Completion tokens: 60
Result: Pass

def add(x: int, y: int) -> int:
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """
    return x + y

✅ Run 7

Start time: 2023-07-18 17:19:32
Duration: 2.42s
Completion tokens: 60
Result: Pass

def add(x: int, y: int) -> int:
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """
    return x + y

✅ Run 8

Start time: 2023-07-18 17:19:29
Duration: 2.6s
Completion tokens: 60
Result: Pass

def add(x: int, y: int) -> int:
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """
    return x + y

✅ Run 9

Start time: 2023-07-18 17:19:26
Duration: 2.95s
Completion tokens: 60
Result: Pass

def add(x: int, y: int) -> int:
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """
    return x + y

✅ Run 10

Start time: 2023-07-18 17:19:23
Duration: 3.06s
Completion tokens: 60
Result: Pass

def add(x: int, y: int) -> int:
    """Add two numbers x and y
    >>> add(2, 3)
    5
    >>> add(5, 7)
    12
    """
    return x + y