File tree Expand file tree Collapse file tree 2 files changed +10
-37
lines changed Expand file tree Collapse file tree 2 files changed +10
-37
lines changed Original file line number Diff line number Diff line change 1
- """Testing
2
- from datasets import load_dataset
3
-
4
- ds = load_dataset("bigcode/humaneval-x-bugs", "python")["test"]
5
- idx = 0
6
-
7
- def get_prompt_base(doc, language="python"):
8
- # See
9
- # https://github.com/roG0d/CodeGeeX/blob/f66205b5f615a4eead9c26d7ec297e14738ea18d/codegeex/benchmark/evaluate_humaneval_x.py#L78
10
- # https://github.com/THUDM/CodeGeeX/pull/76#issuecomment-1500653190
11
- if language == "rust":
12
- main = "fn main(){}\n "
13
- prompt_base = main + doc["declaration"] + doc["prompt"]
14
- else:
15
- prompt_base = doc["prompt"]
16
- return prompt_base
17
-
18
- prompt_base = get_prompt_base(ds[idx], language="python")
19
-
20
- messages = [
21
- {
22
- "role": "user",
23
- "content": ds[idx]["instruction"],
24
- },
25
- {
26
- "role": "assistant",
27
- "content": prompt_base,
28
- },
29
- ]
30
-
31
- gpt-4-0613
32
- response = openai.ChatCompletion.create(
33
- model="gpt-4-0613",
34
- messages=messages
35
- )
36
- """
37
-
38
1
import os
39
2
import openai
40
3
from openai import OpenAI
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Loop through all python files in the current directory
4
+ for file in data/processed/* .py; do
5
+ pytest " $file "
6
+ if [ $? -ne 0 ]; then
7
+ echo " Pytest failed on $file , stopping..."
8
+ exit 1
9
+ fi
10
+ done
You can’t perform that action at this time.
0 commit comments