Spaces:
Sleeping
Sleeping
acecalisto3
commited on
Delete gemmacode
Browse files- gemmacode/init.py +0 -1
- gemmacode/utils.py +0 -19
gemmacode/init.py
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
from .code_generator import generate
|
|
|
|
gemmacode/utils.py
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
|
3 |
-
def generate_code(model, tokenizer, idea):
|
4 |
-
input_text = f"""
|
5 |
-
# Idea: {idea}
|
6 |
-
|
7 |
-
# Code:
|
8 |
-
"""
|
9 |
-
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
10 |
-
output_sequences = model.generate(
|
11 |
-
input_ids=input_ids,
|
12 |
-
max_length=1024,
|
13 |
-
num_return_sequences=1,
|
14 |
-
no_repeat_ngram_size=2,
|
15 |
-
early_stopping=True,
|
16 |
-
)
|
17 |
-
generated_code = tokenizer.decode(output_sequences[0], skip_special_tokens=True)
|
18 |
-
|
19 |
-
return generated_code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|