feat: add request to client app
Browse files- app.py +5 -3
- requirements.txt +1 -0
app.py
CHANGED
@@ -378,16 +378,18 @@ async def remove_image_background(image: UploadFile = File(...), token: str = De
|
|
378 |
def root_route():
|
379 |
return JSONResponse({"message": "Hi"})
|
380 |
|
381 |
-
|
382 |
# Launch the Gradio app
|
383 |
if __name__ == "__main__":
|
384 |
print("APPLICATION IS RUNNING ...")
|
385 |
import uvicorn
|
386 |
-
from gradio import mount_gradio_app
|
387 |
|
388 |
pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
|
389 |
pipeline.cuda()
|
390 |
|
391 |
print("STARTING SERVER ...")
|
392 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
393 |
-
print("SERVER STARTED!!!")
|
|
|
|
|
|
|
|
378 |
def root_route():
|
379 |
return JSONResponse({"message": "Hi"})
|
380 |
|
381 |
+
import requests
|
382 |
# Launch the Gradio app
|
383 |
if __name__ == "__main__":
|
384 |
print("APPLICATION IS RUNNING ...")
|
385 |
import uvicorn
|
|
|
386 |
|
387 |
pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
|
388 |
pipeline.cuda()
|
389 |
|
390 |
print("STARTING SERVER ...")
|
391 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
392 |
+
print("SERVER STARTED!!!")
|
393 |
+
|
394 |
+
#When ever server starts running again, it will send a request to the client application, to run the requests queues
|
395 |
+
requests.get(os.getenv("REQUEST_QUEUE_URL"))
|
requirements.txt
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
--extra-index-url https://download.pytorch.org/whl/cu113
|
2 |
torch
|
3 |
|
|
|
4 |
torchvision==0.19.0
|
5 |
pillow==10.4.0
|
6 |
imageio==2.36.1
|
|
|
1 |
--extra-index-url https://download.pytorch.org/whl/cu113
|
2 |
torch
|
3 |
|
4 |
+
requests
|
5 |
torchvision==0.19.0
|
6 |
pillow==10.4.0
|
7 |
imageio==2.36.1
|