Update app.py
Browse files
app.py
CHANGED
|
@@ -1,26 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
with gr.Blocks(fill_height=True
|
| 4 |
-
with gr.
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
"Sign in with your Hugging Face account to run predictions."
|
| 12 |
-
)
|
| 13 |
-
login_btn = gr.LoginButton("🔑 Sign in with Hugging Face", variant="primary")
|
| 14 |
-
|
| 15 |
-
with gr.Column(scale=3):
|
| 16 |
-
gr.Markdown("### Upload an Image to Detect Plant Disease")
|
| 17 |
-
# Load the Hugging Face model directly into the Gradio interface
|
| 18 |
-
gr.load(
|
| 19 |
-
"models/Diginsa/Plant-Disease-Detection-Project",
|
| 20 |
-
accept_token=login_btn,
|
| 21 |
-
provider="hf-inference",
|
| 22 |
-
height=600
|
| 23 |
-
)
|
| 24 |
-
|
| 25 |
-
if __name__ == "__main__":
|
| 26 |
-
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
with gr.Blocks(fill_height=True) as demo:
|
| 4 |
+
with gr.Sidebar():
|
| 5 |
+
gr.Markdown("# Inference Provider")
|
| 6 |
+
gr.Markdown("This Space showcases the Diginsa/Plant-Disease-Detection-Project model, served by the hf-inference API. Sign in with your Hugging Face account to use this API.")
|
| 7 |
+
button = gr.LoginButton("Sign in")
|
| 8 |
+
gr.load("models/Diginsa/Plant-Disease-Detection-Project", accept_token=button, provider="hf-inference")
|
| 9 |
+
|
| 10 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|