Skip to content

Latest commit

 

History

History
137 lines (118 loc) · 2.91 KB

File metadata and controls

137 lines (118 loc) · 2.91 KB

StarCoderBase Model Evaluation Results (Training Data: 1%

Summary

  • Training Data Size: 1% of dataset
  • Syntax Accuracy: 62.50%
  • Execution Accuracy: 62.50%
  • Functional Accuracy: 62.50%

Test Case Results

Test 1: Add two numbers a and b

def add(a,b):
    return a+b
    t(add(10,2))

Test Input: print(add(5,7)) Expected Output: 12 Actual Output: 12 Success: True Output Matches: False

Test 2: Calculate factorial of a number n

def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n-1)

Test Input: print(factorial(5)) Expected Output: 120 Actual Output: Runtime Error: name 'factorial' is not defined Success: False Output Matches: False

Test 3: Check if a number is prime

def is_prime(n):
    """Check if n is prime"""
    for i in range(2, int(math.sqrt(n))+1):
        if n % i == 0:
            return False
    return True

Test Input: print(is_prime(17)) Expected Output: True Actual Output: Runtime Error: name 'math' is not defined Success: False Output Matches: False

Test 4: Reverse a string

def reverse_string(s):
    return s[::-1]

Test Input: print(reverse_string("hello")) Expected Output: olleh Actual Output: olleh Success: True Output Matches: False

Test 5: Find the maximum value in a list of numbers

def find_max(list):
    """Finds the maximum value in a list of numbers"""
    # Write your code here.
    max = 0
    for i in range(len(list)):
        if list[i] > max:
            max = list[i]
    return max

Test Input: print(find_max([5, 42, 17, 8, 1])) Expected Output: 42 Actual Output: 42 Success: True Output Matches: False

Test 6: Count the number of vowels in a string

def count_vowels(string):
    """
    >>> count_vowels('Hello')
    5
    >>> count_vowels('Hello world')
    6
    """
    return len([c for c in string if c == 'a' or c == 'e' or c == 'i' or c == 'o' or c == 'u'])

Test Input: print(count_vowels("hello")) Expected Output: 2 Actual Output: 2 Success: True Output Matches: False

Test 7: Generate Fibonacci sequence up to n terms

def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n-2) + fibonacci(n-1)
    t(fibonacci(5))

Test Input: print(fibonacci(5)) Expected Output: [0, 1, 1, 2, 3] Actual Output: Runtime Error: name 'fibonacci' is not defined Success: False Output Matches: False

Test 8: Convert temperature from Celsius to Fahrenheit

def celsius_to_fahrenheit(temp):
    return (temp * 9/5) + 32

Test Input: print(celsius_to_fahrenheit(37)) Expected Output: 98.6 Actual Output: 98.6 Success: True Output Matches: False