Spaces:
Runtime error
Runtime error
Revert to old interface
Browse files
app.py
CHANGED
|
@@ -15,45 +15,31 @@ def greet(name, length, function_words, grade_level, sarcasm, formality, voice,
|
|
| 15 |
f"Expository: {expository}"
|
| 16 |
)
|
| 17 |
return response
|
| 18 |
-
|
| 19 |
-
def set_slider_value():
|
| 20 |
-
return 0.5
|
| 21 |
-
|
| 22 |
-
with gr.Blocks() as demo:
|
| 23 |
-
gr.Markdown("# 1) Input Text\n### Enter the text to be obfuscated.")
|
| 24 |
-
name = gr.Textbox(label="Input Text", value="The quick brown fox jumped over the lazy dogs.")
|
| 25 |
-
gr.Markdown("# 2) Style Element Sliders\n### Adjust the style element sliders to the desired levels to steer the obfuscation.")
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
]
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
output = gr.Textbox(label="Output")
|
| 56 |
-
|
| 57 |
-
demo.add(name, *sliders, button, output)
|
| 58 |
-
|
| 59 |
-
demo.launch()
|
|
|
|
| 15 |
f"Expository: {expository}"
|
| 16 |
)
|
| 17 |
return response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
demo = gr.Interface(
|
| 20 |
+
fn=greet,
|
| 21 |
+
inputs=[
|
| 22 |
+
gr.components.Markdown("# 1) Input Text\n### Enter the text to be obfuscated."), # Markdown as a header
|
| 23 |
+
gr.Textbox(
|
| 24 |
+
label="Input Text",
|
| 25 |
+
value="The quick brown fox jumped over the lazy dogs."
|
| 26 |
+
), # Text input for the name
|
| 27 |
+
gr.components.Markdown(
|
| 28 |
+
"# 2) Style Element Sliders\n### Adjust the style element sliders to the desired levels to steer the obfuscation."
|
| 29 |
+
), # Markdown as a header for sliders
|
| 30 |
+
gr.Slider(label="Length (Shorter \u2192 Longer)", minimum=-1, maximum=1, step=0.01, value=0),
|
| 31 |
+
gr.Slider(label="Function Words (Fewer \u2192 More)", minimum=-1, maximum=1, step=0.01, value=0),
|
| 32 |
+
gr.Slider(label="Grade Level (Lower \u2192 Higher)", minimum=-1, maximum=1, step=0.01, value=0),
|
| 33 |
+
gr.Slider(label="Formality (Less \u2192 More)", minimum=-1, maximum=1, step=0.01, value=0),
|
| 34 |
+
gr.Slider(label="Sarcasm (Less * \u2192 More)", minimum=-1, maximum=1, step=0.01, value=0),
|
| 35 |
+
gr.Slider(label="Voice (Passive * \u2192 Active)", minimum=-1, maximum=1, step=0.01, value=0),
|
| 36 |
+
gr.Slider(label="Writing Type: Persuasive (None \u2192 More)", minimum=0, maximum=1, step=0.01, value=0),
|
| 37 |
+
gr.Slider(label="Writing Type: Descriptive (None \u2192 More)", minimum=0, maximum=1, step=0.01, value=0),
|
| 38 |
+
gr.Slider(label="Writing Type: Narrativce (None \u2192 More)", minimum=0, maximum=1, step=0.01, value=0),
|
| 39 |
+
gr.Slider(label="Writing Type: Expository (None \u2192 More)", minimum=0, maximum=1, step=0.01, value=0),
|
| 40 |
+
|
| 41 |
+
],
|
| 42 |
+
outputs=gr.Textbox(label="Output")
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|