Enable API mode and configure endpoint for Gradio interface
Browse files
app.py
CHANGED
@@ -48,10 +48,13 @@ demo = gr.Interface(
|
|
48 |
allow_flagging="never"
|
49 |
)
|
50 |
|
51 |
-
# Launch the app with
|
52 |
if __name__ == "__main__":
|
53 |
demo.queue()
|
54 |
demo.launch(
|
55 |
server_name="0.0.0.0",
|
56 |
-
server_port=7860
|
|
|
|
|
|
|
57 |
)
|
|
|
48 |
allow_flagging="never"
|
49 |
)
|
50 |
|
51 |
+
# Launch the app with API configuration
|
52 |
if __name__ == "__main__":
|
53 |
demo.queue()
|
54 |
demo.launch(
|
55 |
server_name="0.0.0.0",
|
56 |
+
server_port=7860,
|
57 |
+
share=False,
|
58 |
+
api_mode=True, # Enable API mode
|
59 |
+
api_name="/api/predict" # Set API endpoint name
|
60 |
)
|