Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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(
|
|
@@ -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" #
|
| 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()
|
|
|
|
|
|
|
|
|
|
|
|