Spaces:
Runtime error
Runtime error
Commit
·
db91e40
1
Parent(s):
d9183a3
remove ranking json cache, expand description
Browse files
app.py
CHANGED
@@ -29,9 +29,6 @@ preloadModels = {}
|
|
29 |
for m in list(modelPath.keys()):
|
30 |
preloadModels[m] = ecco.from_pretrained(modelPath[m])
|
31 |
|
32 |
-
topComments = []
|
33 |
-
rankings = requests.get("https://code-adv.herokuapp.com/db").json()['results']
|
34 |
-
|
35 |
def generation(tokenizer, model, content):
|
36 |
decoder = 'Standard'
|
37 |
num_beams = 2 if decoder == 'Beam' else None
|
@@ -66,7 +63,6 @@ def generation(tokenizer, model, content):
|
|
66 |
return [
|
67 |
"".join(full_output.tokens),
|
68 |
str(prob.item() * 100),
|
69 |
-
rankings
|
70 |
]
|
71 |
|
72 |
def clean_comment(txt):
|
@@ -138,8 +134,7 @@ iface = gr.Interface(
|
|
138 |
outputs=[
|
139 |
gr.components.Textbox(label="Most probable code"),
|
140 |
gr.components.Textbox(label="Probability of concat"),
|
141 |
-
gr.components.Json(value=rankings)
|
142 |
],
|
143 |
-
description="Prompt the code model to write a SQL query with string concatenation.",
|
144 |
)
|
145 |
iface.launch()
|
|
|
29 |
for m in list(modelPath.keys()):
|
30 |
preloadModels[m] = ecco.from_pretrained(modelPath[m])
|
31 |
|
|
|
|
|
|
|
32 |
def generation(tokenizer, model, content):
|
33 |
decoder = 'Standard'
|
34 |
num_beams = 2 if decoder == 'Beam' else None
|
|
|
63 |
return [
|
64 |
"".join(full_output.tokens),
|
65 |
str(prob.item() * 100),
|
|
|
66 |
]
|
67 |
|
68 |
def clean_comment(txt):
|
|
|
134 |
outputs=[
|
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()
|