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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
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
31
  demo = gr.Interface(
32
  fn=classify_tone,
33
  inputs=gr.Textbox(
@@ -42,8 +42,13 @@ demo = gr.Interface(
42
  ["This is absolutely terrible and I hate it!"],
43
  ["Thank you so much for your help!"],
44
  ["The meeting is scheduled for 3pm tomorrow."],
45
- ]
 
46
  )
47
 
48
  if __name__ == "__main__":
49
- demo.launch()
 
 
 
 
 
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(
 
42
  ["This is absolutely terrible and I hate it!"],
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
+ )