Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,13 +7,13 @@ description = "This is a space to convert english text to Python code using with
|
|
7 |
a code generation model for Python finetuned on [github-jupyter-text](https://huggingface.co/datasets/codeparrot/github-jupyter-text) a dataset of doctrings\
|
8 |
and their Python code extracted from Jupyter notebooks."
|
9 |
example = [
|
10 |
-
["implement bubble sort",
|
11 |
-
["get size of a file filepath",
|
12 |
-
["print hello world",
|
13 |
|
14 |
# change model to the finetuned one
|
15 |
-
tokenizer = AutoTokenizer.from_pretrained("codeparrot/codeparrot-small")
|
16 |
-
model = AutoModelForCausalLM.from_pretrained("codeparrot/codeparrot-small")
|
17 |
|
18 |
def make_doctring(gen_prompt):
|
19 |
return "\"\"\"\n" + gen_prompt + "\n\"\"\"\n\n"
|
|
|
7 |
a code generation model for Python finetuned on [github-jupyter-text](https://huggingface.co/datasets/codeparrot/github-jupyter-text) a dataset of doctrings\
|
8 |
and their Python code extracted from Jupyter notebooks."
|
9 |
example = [
|
10 |
+
["implement bubble sort", 32, 0.6, 42],
|
11 |
+
["get size of a file filepath", 32, 0.6, 42],
|
12 |
+
["print hello world", 18, 0.6, 42]]
|
13 |
|
14 |
# change model to the finetuned one
|
15 |
+
tokenizer = AutoTokenizer.from_pretrained("codeparrot/codeparrot-small-text-to-code")
|
16 |
+
model = AutoModelForCausalLM.from_pretrained("codeparrot/codeparrot-small-text-to-code")
|
17 |
|
18 |
def make_doctring(gen_prompt):
|
19 |
return "\"\"\"\n" + gen_prompt + "\n\"\"\"\n\n"
|