Rahmat82 commited on
Commit
dd81e96
Β·
verified Β·
1 Parent(s): 42d0c2f

changed submit button label to classify

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -30,18 +30,19 @@ def predict(query: str) -> dict:
30
  return label2ids
31
 
32
  demo = gr.Interface(
33
- title="RHM Emotion Classifier 😊",
34
- description="<b> NOTE: </b> Can be a bit slower here 🐒 <h3>On GPU it is much faster πŸš€</h3>",
35
- fn=predict,
36
- inputs=gr.components.Textbox(label='Write your text here', lines=3),
37
- outputs=gr.components.Label(label='Predictions', num_top_classes=6),
38
- allow_flagging='never',
39
- examples=[
 
 
40
  ["The gentle touch of your hand on mine is a silent promise that echoes through the corridors of my heart."],
41
  ["The rain mirrored the tears I couldn't stop, each drop a tiny echo of the ache in my heart. The world seemed muted, colors drained, and a heavy weight settled upon my soul."],
42
  ["Walking through the dusty attic, I stumbled upon a hidden door. With a mix of trepidation and excitement, I pushed it open, expecting cobwebs and forgotten junk. Instead, a flood of sunlight revealed a secret garden, blooming with vibrant flowers and buzzing with life. My jaw dropped in pure astonishment."],
43
-
44
- ]
45
  )
46
 
47
  demo.launch(share=True)
 
30
  return label2ids
31
 
32
  demo = gr.Interface(
33
+ theme = gr.themes.Soft(),
34
+ title = "RHM Emotion Classifier 😊",
35
+ description = "<b> NOTE: </b> Can be a bit slower here 🐒 <h3>On GPU it is much faster πŸš€</h3>",
36
+ fn = predict,
37
+ inputs = gr.components.Textbox(label='Write your text here', lines=3),
38
+ outputs = gr.components.Label(label='Predictions', num_top_classes=6),
39
+ submit_btn = gr.Button("Classify", variant="primary"),
40
+ allow_flagging = 'never',
41
+ examples = [
42
  ["The gentle touch of your hand on mine is a silent promise that echoes through the corridors of my heart."],
43
  ["The rain mirrored the tears I couldn't stop, each drop a tiny echo of the ache in my heart. The world seemed muted, colors drained, and a heavy weight settled upon my soul."],
44
  ["Walking through the dusty attic, I stumbled upon a hidden door. With a mix of trepidation and excitement, I pushed it open, expecting cobwebs and forgotten junk. Instead, a flood of sunlight revealed a secret garden, blooming with vibrant flowers and buzzing with life. My jaw dropped in pure astonishment."],
45
+ ]
 
46
  )
47
 
48
  demo.launch(share=True)