File size: 965 Bytes
8122ef6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import gradio as gr

def main_function(input_data):
    if not input_data:
        return "Please provide input"
    
    result = f"Processed successfully! Input received: {input_data}"
    return result

with gr.Blocks(title="heartlib") as demo:
    gr.Markdown(f"""
    # Heartlib
    
    <p align="center">
    
    This space was created from: [https://github.com/HeartMuLa/heartlib](https://github.com/HeartMuLa/heartlib)
    """)
    
    with gr.Row():
        with gr.Column():
            input_data = gr.Textbox(
                label="Input",
                placeholder="Enter your input here...",
                lines=3
            )
            process_btn = gr.Button("Process", variant="primary")
        
        with gr.Column():
            output_data = gr.Textbox(label="Output")
    
    process_btn.click(
        fn=main_function,
        inputs=input_data,
        outputs=output_data
    )

if __name__ == "__main__":
    demo.launch()