bvishnu123 commited on
Commit
7adfed6
1 Parent(s): ee1fcfa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -4
app.py CHANGED
@@ -1,8 +1,21 @@
1
  import gradio as gr
2
 
3
- def concat_text(title, description):
4
- return title + " " + description
 
5
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- app = gr.Interface(fn=concat_text, inputs="text", outputs="text")
8
- app.launch()
 
1
  import gradio as gr
2
 
3
+ def process_input(title, description):
4
+ """Concatenates the title and description."""
5
+ return f"Title: {title}\nDescription: {description}"
6
 
7
+ def main():
8
+ # Define the interface
9
+ interface = gr.Interface(
10
+ fn=process_input, # the function to process input
11
+ inputs=[gr.Textbox(label="Title"), gr.Textbox(label="Description", lines=4)], # input fields
12
+ outputs=gr.Textbox(label="Output"), # output field
13
+ title="Simple Gradio App",
14
+ description="This is a simple Gradio app that concatenates title and description."
15
+ )
16
+
17
+ # Launch the interface
18
+ interface.launch()
19
 
20
+ if __name__ == "__main__":
21
+ main()