Update README.md
Browse files
README.md
CHANGED
@@ -23,7 +23,8 @@ device = 'cuda'
|
|
23 |
model = GPTNeoXForCausalLM.from_pretrained(model_name_or_path).to(device)
|
24 |
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
|
25 |
|
26 |
-
|
|
|
27 |
# any c-lang pieces you like, could be partial functions or statements
|
28 |
input_content = '''```c
|
29 |
int partition(int arr[], int low, int high) {
|
@@ -78,7 +79,7 @@ for i in range(30): # maybe 20 times or less enough too
|
|
78 |
pad_token_id=tokenizer.eos_token_id,
|
79 |
max_new_tokens=32,
|
80 |
do_sample=True,
|
81 |
-
temperature=2.0,
|
82 |
top_p=0.95,
|
83 |
top_k=30,
|
84 |
)
|
@@ -87,5 +88,11 @@ for i in range(30): # maybe 20 times or less enough too
|
|
87 |
|
88 |
print(ans_dict)
|
89 |
### output as below, could take high-freq answers
|
90 |
-
### {
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
```
|
|
|
23 |
model = GPTNeoXForCausalLM.from_pretrained(model_name_or_path).to(device)
|
24 |
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
|
25 |
|
26 |
+
# instruction template
|
27 |
+
instruction = '[Summarize the knowledge points in the code below]\n'
|
28 |
# any c-lang pieces you like, could be partial functions or statements
|
29 |
input_content = '''```c
|
30 |
int partition(int arr[], int low, int high) {
|
|
|
79 |
pad_token_id=tokenizer.eos_token_id,
|
80 |
max_new_tokens=32,
|
81 |
do_sample=True,
|
82 |
+
temperature=2.0, # high temperature for diversity
|
83 |
top_p=0.95,
|
84 |
top_k=30,
|
85 |
)
|
|
|
88 |
|
89 |
print(ans_dict)
|
90 |
### output as below, could take high-freq answers
|
91 |
+
### {
|
92 |
+
### 'Backtracking': 1,
|
93 |
+
### 'Heap': 1,
|
94 |
+
### 'Quick sort': 25,
|
95 |
+
### 'Recurrence': 2,
|
96 |
+
### 'Queue': 1
|
97 |
+
###}
|
98 |
```
|