Skip to content

Latest commit

 

History

History
198 lines (194 loc) · 3.54 KB

53.md

File metadata and controls

198 lines (194 loc) · 3.54 KB

Results of GPT-4 on HumanEval/53

Date: 18 July, 2023
Model: gpt-4
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 18:36:14
Duration: 7.31s
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 18:36:08
Duration: 5.88s
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 18:36:03
Duration: 5.41s
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 18:35:55
Duration: 7.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 5

Start time: 2023-07-18 18:35:50
Duration: 4.93s
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 18:35:44
Duration: 6.26s
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 18:35:39
Duration: 4.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 8

Start time: 2023-07-18 18:35:33
Duration: 6.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 9

Start time: 2023-07-18 18:35:27
Duration: 5.78s
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 18:35:21
Duration: 5.43s
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