File size: 673 Bytes
6f97919 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
# Secret Code Generator (Reverse the input)
def secret_code(input_text):
# Reverse the input text to make it 'secret'
return input_text[::-1]
# Gradio interface
with gr.Blocks() as demo:
input_text = gr.Textbox(label="Enter your text")
output_text = gr.Textbox(label="Secret Code")
# Button to convert to secret code
btn_secret = gr.Button("Convert to Secret Code")
btn_secret.click(secret_code, inputs=input_text, outputs=output_text)
# Button to decode secret code
btn_decode = gr.Button("Decode the Secret Code")
btn_decode.click(secret_code, inputs=output_text, outputs=input_text)
demo.launch()
|