Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| def transform(text): | |
| """ | |
| Simple transformation function for anycoder 2. | |
| Takes text input and returns reversed text. | |
| """ | |
| if not text: | |
| return "" | |
| return text[::-1] | |
| with gr.Blocks() as demo: | |
| gr.Markdown( | |
| "<h1>anycoder 2</h1>" | |
| '<p><a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">' | |
| "Built with anycoder</a></p>" | |
| ) | |
| with gr.Row(): | |
| input_box = gr.Textbox(label="Input Text", placeholder="Type something...") | |
| output_box = gr.Textbox(label="Output Text") | |
| run_btn = gr.Button("Run Transformation", variant="primary") | |
| run_btn.click( | |
| fn=transform, | |
| inputs=[input_box], | |
| outputs=[output_box], | |
| api_visibility="public" | |
| ) | |
| demo.launch( | |
| theme=gr.themes.Soft(primary_hue="blue"), | |
| footer_links=[ | |
| {"label": "Built with anycoder", "url": "https://huggingface.co/spaces/akhaliq/anycoder"} | |
| ] | |
| ) |