Spaces:
Paused
Paused
yuxiaoyuan0406
commited on
Commit
•
4cfbacd
1
Parent(s):
faffc59
fix sub-path deploy
Browse files
main.py
CHANGED
@@ -171,4 +171,21 @@ def auto_opentab_delay():
|
|
171 |
threading.Thread(target=auto_update, name="self-upgrade", daemon=True).start()
|
172 |
|
173 |
auto_opentab_delay()
|
174 |
-
demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=PORT, auth=AUTHENTICATION)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
threading.Thread(target=auto_update, name="self-upgrade", daemon=True).start()
|
172 |
|
173 |
auto_opentab_delay()
|
174 |
+
# demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", server_port=PORT, auth=AUTHENTICATION)
|
175 |
+
demo.queue(concurrency_count=CONCURRENT_COUNT)
|
176 |
+
|
177 |
+
CUSTOM_PATH = '/chatgpt'
|
178 |
+
|
179 |
+
import uvicorn
|
180 |
+
from fastapi import FastAPI
|
181 |
+
|
182 |
+
app = FastAPI()
|
183 |
+
|
184 |
+
@app.get("/")
|
185 |
+
def read_main():
|
186 |
+
return {"message": "NULL"}
|
187 |
+
|
188 |
+
app = gr.mount_gradio_app(app, demo, path=CUSTOM_PATH)
|
189 |
+
|
190 |
+
if __name__ == '__main__':
|
191 |
+
uvicorn.run(app, host="0.0.0.0", port=PORT)
|