Spaces:
Running
on
T4
Running
on
T4
Upload gradio_app.py
Browse files- gradio_app.py +8 -6
gradio_app.py
CHANGED
@@ -707,8 +707,8 @@ if __name__ == '__main__':
|
|
707 |
</div>
|
708 |
"""
|
709 |
|
710 |
-
demo = gr.Interface(fn=my_gpu_function, inputs=[], outputs="text")
|
711 |
-
demo.launch()
|
712 |
|
713 |
example_is = get_example_img_list()
|
714 |
example_ts = get_example_txt_list()
|
@@ -768,15 +768,17 @@ if __name__ == '__main__':
|
|
768 |
|
769 |
# https://discuss.huggingface.co/t/how-to-serve-an-html-file/33921/2
|
770 |
# create a FastAPI app
|
771 |
-
app = FastAPI()
|
772 |
# create a static directory to store the static files
|
773 |
static_dir = Path(SAVE_DIR).absolute()
|
774 |
static_dir.mkdir(parents=True, exist_ok=True)
|
775 |
-
app.mount("/static", StaticFiles(directory=static_dir, html=True), name="static")
|
776 |
shutil.copytree('./assets/env_maps', os.path.join(static_dir, 'env_maps'), dirs_exist_ok=True)
|
777 |
|
|
|
778 |
if args.low_vram_mode:
|
779 |
torch.cuda.empty_cache()
|
780 |
demo = build_app()
|
781 |
-
|
782 |
-
|
|
|
|
707 |
</div>
|
708 |
"""
|
709 |
|
710 |
+
#demo = gr.Interface(fn=my_gpu_function, inputs=[], outputs="text")
|
711 |
+
#demo.launch()
|
712 |
|
713 |
example_is = get_example_img_list()
|
714 |
example_ts = get_example_txt_list()
|
|
|
768 |
|
769 |
# https://discuss.huggingface.co/t/how-to-serve-an-html-file/33921/2
|
770 |
# create a FastAPI app
|
771 |
+
#app = FastAPI()
|
772 |
# create a static directory to store the static files
|
773 |
static_dir = Path(SAVE_DIR).absolute()
|
774 |
static_dir.mkdir(parents=True, exist_ok=True)
|
775 |
+
#app.mount("/static", StaticFiles(directory=static_dir, html=True), name="static")
|
776 |
shutil.copytree('./assets/env_maps', os.path.join(static_dir, 'env_maps'), dirs_exist_ok=True)
|
777 |
|
778 |
+
|
779 |
if args.low_vram_mode:
|
780 |
torch.cuda.empty_cache()
|
781 |
demo = build_app()
|
782 |
+
demo.launch()
|
783 |
+
#app = gr.mount_gradio_app(app, demo, path="/")
|
784 |
+
#uvicorn.run(app, host=args.host, port=args.port)
|