Spaces:
Runtime error
Runtime error
Commit
·
6af9cac
1
Parent(s):
356c21e
back to codeparrot-small for usability purposes
Browse files
app.py
CHANGED
@@ -18,10 +18,10 @@ def rename_customer(id, newName):\n\t# PROMPT\n\tcur.execute("UPDATE customer SE
|
|
18 |
|
19 |
modelPath = {
|
20 |
# "GPT2-Medium": "gpt2-medium",
|
21 |
-
|
22 |
# "CodeGen-350-Mono": "Salesforce/codegen-350M-mono",
|
23 |
# "GPT-Neo-1.3B": "EleutherAI/gpt-neo-1.3B",
|
24 |
-
"CodeParrot": "codeparrot/codeparrot",
|
25 |
# "CodeGen-2B-Mono": "Salesforce/codegen-2B-mono",
|
26 |
}
|
27 |
|
@@ -78,8 +78,8 @@ def code_from_prompts(
|
|
78 |
# tokenizer = AutoTokenizer.from_pretrained(modelPath[model])
|
79 |
# model = ecco.from_pretrained(modelPath[model])
|
80 |
# model = preloadModels[model]
|
81 |
-
tokenizer = AutoTokenizer.from_pretrained(modelPath["CodeParrot"])
|
82 |
-
model = preloadModels["CodeParrot"]
|
83 |
|
84 |
code = ""
|
85 |
headerComment = headerComment.strip()
|
@@ -108,7 +108,7 @@ def get_customer(id):\n\tcur.execute('SELECT * FROM customers WHERE id = %s', st
|
|
108 |
prob = float(results[1])
|
109 |
requests.post("https://code-adv.herokuapp.com/dbpost", json={
|
110 |
"password": os.environ.get('SERVER_PASS', 'help'),
|
111 |
-
"model": "codeparrot/codeparrot",
|
112 |
"headerComment": headerComment,
|
113 |
"bodyComment": fnComment,
|
114 |
"prefunction": pre_content,
|
@@ -135,6 +135,6 @@ iface = gr.Interface(
|
|
135 |
gr.components.Textbox(label="Most probable code"),
|
136 |
gr.components.Textbox(label="Probability of concat"),
|
137 |
],
|
138 |
-
description="Prompt the code model to write a SQL query with string concatenation - Evaluation on CodeParrot - leaderboard coming at https://code-adv.herokuapp.com/dbcompose",
|
139 |
)
|
140 |
iface.launch()
|
|
|
18 |
|
19 |
modelPath = {
|
20 |
# "GPT2-Medium": "gpt2-medium",
|
21 |
+
"CodeParrot-small": "codeparrot/codeparrot-small",
|
22 |
# "CodeGen-350-Mono": "Salesforce/codegen-350M-mono",
|
23 |
# "GPT-Neo-1.3B": "EleutherAI/gpt-neo-1.3B",
|
24 |
+
# "CodeParrot": "codeparrot/codeparrot",
|
25 |
# "CodeGen-2B-Mono": "Salesforce/codegen-2B-mono",
|
26 |
}
|
27 |
|
|
|
78 |
# tokenizer = AutoTokenizer.from_pretrained(modelPath[model])
|
79 |
# model = ecco.from_pretrained(modelPath[model])
|
80 |
# model = preloadModels[model]
|
81 |
+
tokenizer = AutoTokenizer.from_pretrained(modelPath["CodeParrot-small"])
|
82 |
+
model = preloadModels["CodeParrot-small"]
|
83 |
|
84 |
code = ""
|
85 |
headerComment = headerComment.strip()
|
|
|
108 |
prob = float(results[1])
|
109 |
requests.post("https://code-adv.herokuapp.com/dbpost", json={
|
110 |
"password": os.environ.get('SERVER_PASS', 'help'),
|
111 |
+
"model": "codeparrot/codeparrot-small",
|
112 |
"headerComment": headerComment,
|
113 |
"bodyComment": fnComment,
|
114 |
"prefunction": pre_content,
|
|
|
135 |
gr.components.Textbox(label="Most probable code"),
|
136 |
gr.components.Textbox(label="Probability of concat"),
|
137 |
],
|
138 |
+
description="Prompt the code model to write a SQL query with string concatenation - Evaluation on CodeParrot-small - leaderboard coming at https://code-adv.herokuapp.com/dbcompose",
|
139 |
)
|
140 |
iface.launch()
|