Spaces:
Runtime error
Runtime error
Add grade level
Browse files
app.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def greet(name, length, function_words, sarcasm, formality, voice, persuasive, descriptive, narrative, expository):
|
| 4 |
response = (
|
| 5 |
f"Hello {name}!\n"
|
| 6 |
f"Length: {length}\n"
|
| 7 |
f"Function Words: {function_words}\n"
|
|
|
|
| 8 |
f"Sarcasm: {sarcasm}\n"
|
| 9 |
f"Formality: {formality}\n"
|
| 10 |
f"Voice: {voice}\n"
|
|
@@ -18,13 +19,13 @@ def greet(name, length, function_words, sarcasm, formality, voice, persuasive, d
|
|
| 18 |
demo = gr.Interface(
|
| 19 |
fn=greet,
|
| 20 |
inputs=[
|
| 21 |
-
gr.components.Markdown("
|
| 22 |
gr.Textbox(
|
| 23 |
label="Input Text",
|
| 24 |
value="The quick brown fox jumped over the lazy dogs."
|
| 25 |
), # Text input for the name
|
| 26 |
gr.components.Markdown(
|
| 27 |
-
"
|
| 28 |
), # Markdown as a header for sliders
|
| 29 |
gr.Slider(label="Length (Shorter \u2192 Longer)", minimum=-1, maximum=1, step=0.01, value=0),
|
| 30 |
gr.Slider(label="Function Words (Fewer \u2192 More)", minimum=-1, maximum=1, step=0.01, value=0),
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
def greet(name, length, function_words, grade_level, sarcasm, formality, voice, persuasive, descriptive, narrative, expository):
|
| 4 |
response = (
|
| 5 |
f"Hello {name}!\n"
|
| 6 |
f"Length: {length}\n"
|
| 7 |
f"Function Words: {function_words}\n"
|
| 8 |
+
f"Grade Level: {grade_level}\n"
|
| 9 |
f"Sarcasm: {sarcasm}\n"
|
| 10 |
f"Formality: {formality}\n"
|
| 11 |
f"Voice: {voice}\n"
|
|
|
|
| 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 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),
|