Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ def get_label(output):
|
|
20 |
labels = ClassLabel(num_classes=7, names=['constant', 'linear', 'np', 'logn', 'quadratic', 'nlogn', 'cubic'])
|
21 |
return labels.int2str(label)
|
22 |
|
23 |
-
def complexity_estimation(gen_prompt
|
24 |
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
25 |
output = pipe(gen_prompt)[0]
|
26 |
# add label conversion to class
|
@@ -33,13 +33,6 @@ iface = gr.Interface(
|
|
33 |
fn=complexity_estimation,
|
34 |
inputs=[
|
35 |
gr.Textbox(lines=10, label="Input code"),
|
36 |
-
gr.inputs.Slider(
|
37 |
-
minimum=1,
|
38 |
-
maximum=3,
|
39 |
-
step=1,
|
40 |
-
default=1,
|
41 |
-
label="Number of results to return",
|
42 |
-
),
|
43 |
],
|
44 |
outputs=[
|
45 |
gr.Textbox(label="Predicted complexity", lines=1) ,
|
@@ -47,7 +40,7 @@ iface = gr.Interface(
|
|
47 |
],
|
48 |
examples=example,
|
49 |
layout="vertical",
|
50 |
-
theme="
|
51 |
description=description,
|
52 |
title=title
|
53 |
)
|
|
|
20 |
labels = ClassLabel(num_classes=7, names=['constant', 'linear', 'np', 'logn', 'quadratic', 'nlogn', 'cubic'])
|
21 |
return labels.int2str(label)
|
22 |
|
23 |
+
def complexity_estimation(gen_prompt):
|
24 |
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
25 |
output = pipe(gen_prompt)[0]
|
26 |
# add label conversion to class
|
|
|
33 |
fn=complexity_estimation,
|
34 |
inputs=[
|
35 |
gr.Textbox(lines=10, label="Input code"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
],
|
37 |
outputs=[
|
38 |
gr.Textbox(label="Predicted complexity", lines=1) ,
|
|
|
40 |
],
|
41 |
examples=example,
|
42 |
layout="vertical",
|
43 |
+
theme="huggingface",
|
44 |
description=description,
|
45 |
title=title
|
46 |
)
|