Spaces:
Cesarcr
/
Runtime error

KingNish commited on
Commit
68bde08
β€’
1 Parent(s): 52811e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -8
app.py CHANGED
@@ -43,14 +43,24 @@ def classify_task2(prompt):
43
  return 'Unknown Task'
44
 
45
  # Create the Gradio interface
46
- iface = gr.Interface(
47
- fn=classify_task,
48
- inputs=gr.Textbox(lines=2, placeholder="Enter your prompt here..."),
49
- outputs='text',
50
- title='AI Task Classifier Chatbot',
51
- description='This chatbot classifies your prompt into different AI tasks.'
52
- )
 
 
 
 
 
 
 
 
 
 
53
 
54
  # Launch the app
55
  if __name__ == "__main__":
56
- iface.launch()
 
43
  return 'Unknown Task'
44
 
45
  # Create the Gradio interface
46
+ with gr.Blocks() as demo:
47
+ gr.HTML("""
48
+ <center><h1>Emoji Translator πŸ€—πŸ˜»</h1>
49
+ <h3>Translate any text into emojis, and vice versa!</h3>
50
+ </center>
51
+ """)
52
+
53
+ gr.Markdown("""
54
+ # Text to Emoji πŸ“–βž‘οΈπŸ˜»
55
+ """)
56
+ with gr.Row():
57
+ text_uesr_input = gr.Textbox(label="Enter text πŸ“š")
58
+ output = gr.Textbox(label="Translation")
59
+ with gr.Row():
60
+ translate_btn = gr.Button("Translate πŸš€")
61
+ translate_btn.click(fn=classify_task, inputs=text_uesr_input,
62
+ outputs=output, api_name="translate_text")
63
 
64
  # Launch the app
65
  if __name__ == "__main__":
66
+ demo.launch()