promptsource icon indicating copy to clipboard operation
promptsource copied to clipboard

Add mbpp

Open Muennighoff opened this issue 3 years ago • 2 comments

Adds mbpp. I kept it simple as the function instructions are already very diverse.

cc @haileyschoelkopf @thomasw21 @lintangsutawika

Two examples:

('Write a function to find the minimum cost path to reach (m, n) from (0, 0) for the given cost matrix cost[][] and a position (m, n) in cost[][]. Here is a solution in Python:', ['R = 3\r\nC = 3\r\ndef min_cost(cost, m, n): \r\n\ttc = [[0 for x in range(C)] for x in range(R)] \r\n\ttc[0][0] = cost[0][0] \r\n\tfor i in range(1, m+1): \r\n\t\ttc[i][0] = tc[i-1][0] + cost[i][0] \r\n\tfor j in range(1, n+1): \r\n\t\ttc[0][j] = tc[0][j-1] + cost[0][j] \r\n\tfor i in range(1, m+1): \r\n\t\tfor j in range(1, n+1): \r\n\t\t\ttc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j] \r\n\treturn tc[m][n]'])
Running prompt: function solved
('Write a function to find the minimum cost path to reach (m, n) from (0, 0) for the given cost matrix cost[][] and a position (m, n) in cost[][]. This can be solved in Python with the following code:', ['R = 3\r\nC = 3\r\ndef min_cost(cost, m, n): \r\n\ttc = [[0 for x in range(C)] for x in range(R)] \r\n\ttc[0][0] = cost[0][0] \r\n\tfor i in range(1, m+1): \r\n\t\ttc[i][0] = tc[i-1][0] + cost[i][0] \r\n\tfor j in range(1, n+1): \r\n\t\ttc[0][j] = tc[0][j-1] + cost[0][j] \r\n\tfor i in range(1, m+1): \r\n\t\tfor j in range(1, n+1): \r\n\t\t\ttc[i][j] = min(tc[i-1][j-1], tc[i-1][j], tc[i][j-1]) + cost[i][j] \r\n\treturn tc[m][n]'])

Muennighoff avatar Jul 18 '22 19:07 Muennighoff

Thanks for doing this! It looks good

haileyschoelkopf avatar Jul 18 '22 19:07 haileyschoelkopf

The dataset download is currently failing. It works for me on Colab. Probably adding ignore_verifications=True. to the load_dataset used in the test would make it work.

Muennighoff avatar Jul 18 '22 21:07 Muennighoff