LokeshDevCreates commited on
Commit
3b90d4a
·
verified ·
1 Parent(s): a7b8697

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -27,7 +27,7 @@ def classify_tone(text):
27
  except Exception as e:
28
  return {"error": str(e)}
29
 
30
- # Create Gradio interface with API exposed
31
  demo = gr.Interface(
32
  fn=classify_tone,
33
  inputs=gr.Textbox(
@@ -43,12 +43,8 @@ demo = gr.Interface(
43
  ["Thank you so much for your help!"],
44
  ["The meeting is scheduled for 3pm tomorrow."],
45
  ],
46
- api_name="predict" # Add this to explicitly name the API endpoint
47
  )
48
 
49
  if __name__ == "__main__":
50
- demo.launch(
51
- server_name="0.0.0.0",
52
- server_port=7860,
53
- show_api=True # ← Add this to show API docs
54
- )
 
27
  except Exception as e:
28
  return {"error": str(e)}
29
 
30
+ # Create Gradio interface
31
  demo = gr.Interface(
32
  fn=classify_tone,
33
  inputs=gr.Textbox(
 
43
  ["Thank you so much for your help!"],
44
  ["The meeting is scheduled for 3pm tomorrow."],
45
  ],
46
+ api_name="predict" # Explicitly name the API endpoint
47
  )
48
 
49
  if __name__ == "__main__":
50
+ demo.launch()