Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from inference_utils import predict_plant_disease
|
| 3 |
|
|
@@ -22,9 +27,14 @@ iface = gr.Interface(
|
|
| 22 |
description=description,
|
| 23 |
examples=examples,
|
| 24 |
flagging_mode="never",
|
| 25 |
-
theme="default",
|
| 26 |
live=False,
|
| 27 |
cache_examples=False,
|
| 28 |
)
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
os.environ["GRADIO_HOT_RELOAD"] = "false" # tránh lỗi jurigged/hot reload trên Spaces (py3.13)
|
| 3 |
+
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
|
| 4 |
+
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
|
| 5 |
+
|
| 6 |
import gradio as gr
|
| 7 |
from inference_utils import predict_plant_disease
|
| 8 |
|
|
|
|
| 27 |
description=description,
|
| 28 |
examples=examples,
|
| 29 |
flagging_mode="never",
|
|
|
|
| 30 |
live=False,
|
| 31 |
cache_examples=False,
|
| 32 |
)
|
| 33 |
|
| 34 |
+
if __name__ == "__main__":
|
| 35 |
+
iface.launch(
|
| 36 |
+
server_name="0.0.0.0",
|
| 37 |
+
server_port=7860,
|
| 38 |
+
ssr_mode=False, # tránh lỗi SSR/thread reload trên Spaces
|
| 39 |
+
theme="default" # theme đưa vào launch() theo Gradio 6
|
| 40 |
+
)
|