Spaces:
Sleeping
Sleeping
Commit
·
0a02840
1
Parent(s):
5922781
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
export GRADIO_SERVER_PORT=
|
5 |
|
6 |
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
7 |
-
|
8 |
def predict(image):
|
9 |
predictions = pipeline(image)
|
10 |
return {p["label"]: p["score"] for p in predictions}
|
@@ -14,4 +14,4 @@ gr.Interface(
|
|
14 |
inputs=gr.inputs.Image(label="Upload hot dog candidate", type="filepath"),
|
15 |
outputs=gr.outputs.Label(num_top_classes=2),
|
16 |
title="Hot Dog? Or Not?",
|
17 |
-
).launch(server_port=8080)
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
export GRADIO_SERVER_PORT=8080
|
5 |
|
6 |
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
7 |
+
|
8 |
def predict(image):
|
9 |
predictions = pipeline(image)
|
10 |
return {p["label"]: p["score"] for p in predictions}
|
|
|
14 |
inputs=gr.inputs.Image(label="Upload hot dog candidate", type="filepath"),
|
15 |
outputs=gr.outputs.Label(num_top_classes=2),
|
16 |
title="Hot Dog? Or Not?",
|
17 |
+
).launch(server_name="your_app_name", server_port=8080)
|