Skip to content

Latest commit

 

History

History
211 lines (207 loc) · 4.95 KB

File metadata and controls

211 lines (207 loc) · 4.95 KB

Results of GPT-3.5 on HumanEval/51

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

Prompt

Tokens: 148

def remove_vowels(text):
    """
    remove_vowels is a function that takes string and returns string without vowels.
    >>> remove_vowels('')
    ''
    >>> remove_vowels("abcdef\nghijklm")
    'bcdf\nghjklm'
    >>> remove_vowels('abcdef')
    'bcdf'
    >>> remove_vowels('aaaaa')
    ''
    >>> remove_vowels('aaBAA')
    'B'
    >>> remove_vowels('zbcd')
    'zbcd'
    """

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

Correct solution

def remove_vowels(text):
    """
    remove_vowels is a function that takes string and returns string without vowels.
    >>> remove_vowels('')
    ''
    >>> remove_vowels("abcdef\nghijklm")
    'bcdf\nghjklm'
    >>> remove_vowels('abcdef')
    'bcdf'
    >>> remove_vowels('aaaaa')
    ''
    >>> remove_vowels('aaBAA')
    'B'
    >>> remove_vowels('zbcd')
    'zbcd'
    """return "".join([s for s in text if s.lower() not in ["a", "e", "i", "o", "u"]])

Unit tests

METADATA = {}


def check(candidate):
    assert candidate('') == ''
    assert candidate("abcdef\nghijklm") == 'bcdf\nghjklm'
    assert candidate('fedcba') == 'fdcb'
    assert candidate('eeeee') == ''
    assert candidate('acBAA') == 'cB'
    assert candidate('EcBOO') == 'cB'
    assert candidate('ybcd') == 'ybcd'

Runs

✅ Run 1

Start time: 2023-07-18 17:20:05
Duration: 4.02s
Completion tokens: 114
Result: Pass

def remove_vowels(text):
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    result = ''
    for char in text:
        if char not in vowels:
            result += char
    return result

print(remove_vowels('abcdef\nghijklm'))
print(remove_vowels('abcdef'))
print(remove_vowels('aaaaa'))
print(remove_vowels('aaBAA'))
print(remove_vowels('zbcd'))

✅ Run 2

Start time: 2023-07-18 17:20:03
Duration: 2.77s
Completion tokens: 65
Result: Pass

def remove_vowels(text):
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    result = ''
    for char in text:
        if char not in vowels:
            result += char
    return result

✅ Run 3

Start time: 2023-07-18 17:19:59
Duration: 3.24s
Completion tokens: 65
Result: Pass

def remove_vowels(text):
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    result = ''
    for char in text:
        if char not in vowels:
            result += char
    return result

✅ Run 4

Start time: 2023-07-18 17:19:56
Duration: 2.92s
Completion tokens: 65
Result: Pass

def remove_vowels(text):
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    result = ''
    for char in text:
        if char not in vowels:
            result += char
    return result

✅ Run 5

Start time: 2023-07-18 17:19:53
Duration: 3.65s
Completion tokens: 75
Result: Pass

def remove_vowels(text):
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    result = ""
    for char in text:
        if char not in vowels:
            result += char
    return result

import doctest
doctest.testmod()

✅ Run 6

Start time: 2023-07-18 17:19:50
Duration: 2.78s
Completion tokens: 65
Result: Pass

def remove_vowels(text):
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    result = ""
    for char in text:
        if char not in vowels:
            result += char
    return result

✅ Run 7

Start time: 2023-07-18 17:19:47
Duration: 2.69s
Completion tokens: 65
Result: Pass

def remove_vowels(text):
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    result = ''
    for char in text:
        if char not in vowels:
            result += char
    return result

✅ Run 8

Start time: 2023-07-18 17:19:44
Duration: 2.99s
Completion tokens: 65
Result: Pass

def remove_vowels(text):
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    result = ''
    for char in text:
        if char not in vowels:
            result += char
    return result

✅ Run 9

Start time: 2023-07-18 17:19:41
Duration: 3.07s
Completion tokens: 65
Result: Pass

def remove_vowels(text):
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    result = ""
    for char in text:
        if char not in vowels:
            result += char
    return result

✅ Run 10

Start time: 2023-07-18 17:19:38
Duration: 2.86s
Completion tokens: 65
Result: Pass

def remove_vowels(text):
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    result = ''
    for char in text:
        if char not in vowels:
            result += char
    return result