Spaces:
Runtime error
Runtime error
update app
Browse files
app.py
CHANGED
|
@@ -28,33 +28,31 @@ def generate(gen_prompt, max_tokens, temperature=0.6, seed=42):
|
|
| 28 |
generated_text = detok_hypo_str[len(BOS):]
|
| 29 |
return generated_text
|
| 30 |
|
| 31 |
-
generation = generate(gen_prompt, length_limit=40, temperature=0.6)
|
| 32 |
-
|
| 33 |
iface = gr.Interface(
|
| 34 |
fn=generate,
|
| 35 |
inputs=[
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
],
|
| 59 |
outputs=gr.Textbox(label="Predicted code", lines=10),
|
| 60 |
examples=example,
|
|
|
|
| 28 |
generated_text = detok_hypo_str[len(BOS):]
|
| 29 |
return generated_text
|
| 30 |
|
|
|
|
|
|
|
| 31 |
iface = gr.Interface(
|
| 32 |
fn=generate,
|
| 33 |
inputs=[
|
| 34 |
+
gr.Textbox(lines=10, label="Input code"),
|
| 35 |
+
gr.inputs.Slider(
|
| 36 |
+
minimum=8,
|
| 37 |
+
maximum=256,
|
| 38 |
+
step=1,
|
| 39 |
+
default=8,
|
| 40 |
+
label="Number of tokens to generate",
|
| 41 |
+
),
|
| 42 |
+
gr.inputs.Slider(
|
| 43 |
+
minimum=0,
|
| 44 |
+
maximum=2,
|
| 45 |
+
step=0.1,
|
| 46 |
+
default=0.6,
|
| 47 |
+
label="Temperature",
|
| 48 |
+
),
|
| 49 |
+
gr.inputs.Slider(
|
| 50 |
+
minimum=0,
|
| 51 |
+
maximum=1000,
|
| 52 |
+
step=1,
|
| 53 |
+
default=42,
|
| 54 |
+
label="Random seed to use for the generation"
|
| 55 |
+
)
|
| 56 |
],
|
| 57 |
outputs=gr.Textbox(label="Predicted code", lines=10),
|
| 58 |
examples=example,
|