Edit app.py
Browse files
app.py
CHANGED
|
@@ -61,13 +61,12 @@ demo = gr.Interface(
|
|
| 61 |
# api_name="predict" # ๋ช
์์ ์ผ๋ก API ์ด๋ฆ์ ์ค์ ํ๋ฉด /api/predict ์๋ํฌ์ธํธ๊ฐ ํ์คํ ์์ฑ๋ฉ๋๋ค.
|
| 62 |
)
|
| 63 |
|
|
|
|
| 64 |
if __name__ == "__main__":
|
| 65 |
-
print("Launching Gradio app...")
|
| 66 |
-
#
|
| 67 |
-
#
|
| 68 |
-
# server_port=7860์ Gradio ๊ธฐ๋ณธ ํฌํธ
|
| 69 |
-
# queue() ์ฌ์ฉ ์ api_open=True๊ฐ ๊ธฐ๋ณธ๊ฐ์ธ ๊ฒฝ์ฐ๊ฐ ๋ง์ /api/predict ์๋ํฌ์ธํธ๊ฐ ํ์ฑํ๋ ๊ฐ๋ฅ์ฑ์ด ๋์
|
| 70 |
demo.queue().launch(server_name="0.0.0.0", server_port=7860)
|
| 71 |
-
#
|
| 72 |
-
|
| 73 |
-
print(f"
|
|
|
|
| 61 |
# api_name="predict" # ๋ช
์์ ์ผ๋ก API ์ด๋ฆ์ ์ค์ ํ๋ฉด /api/predict ์๋ํฌ์ธํธ๊ฐ ํ์คํ ์์ฑ๋ฉ๋๋ค.
|
| 62 |
)
|
| 63 |
|
| 64 |
+
# ... (์ด์ ๋ต๋ณ์ ์์ ๋ app.py ์ฝ๋ ์ ์ฒด) ...
|
| 65 |
if __name__ == "__main__":
|
| 66 |
+
print("Launching Gradio app with queue and explicit API exposure...")
|
| 67 |
+
# queue() ์ฌ์ฉ ์ /api/predict ๊ฐ ๊ธฐ๋ณธ ์๋ํฌ์ธํธ์ผ ๊ฐ๋ฅ์ฑ์ด ๋์
|
| 68 |
+
# ๋๋ api_name์ ๋ช
์์ ์ผ๋ก ์ค์ :
|
|
|
|
|
|
|
| 69 |
demo.queue().launch(server_name="0.0.0.0", server_port=7860)
|
| 70 |
+
# demo.launch(server_name="0.0.0.0", server_port=7860, api_name="predict") # ์ด๋ ๊ฒ ํด๋ ๋จ
|
| 71 |
+
print(f"Gradio app should be accessible at http://localhost:7860")
|
| 72 |
+
print(f"Try API endpoint for Next.js: http://localhost:7860/api/predict (or as defined by api_name)")
|