Spaces:
Runtime error
Runtime error
ayberkuckun
commited on
Commit
·
7d0d8db
1
Parent(s):
7992d05
key
Browse files- .gitignore +0 -1
- app.py +1 -1
- huggingface-spaces-iris-monitor/.hw_api_key +0 -1
- huggingface-spaces-iris-monitor/README.md +0 -13
- huggingface-spaces-iris-monitor/app.py +0 -31
- huggingface-spaces-iris-monitor/requirements.txt +0 -1
- huggingface-spaces-iris/.hw_api_key +0 -1
- huggingface-spaces-iris/README.md +0 -13
- huggingface-spaces-iris/app.py +0 -47
- huggingface-spaces-iris/requirements.txt +0 -3
.gitignore
CHANGED
@@ -1,2 +1 @@
|
|
1 |
.idea/
|
2 |
-
iris_model/
|
|
|
1 |
.idea/
|
|
app.py
CHANGED
@@ -12,7 +12,7 @@ project = hopsworks.login()
|
|
12 |
fs = project.get_feature_store()
|
13 |
|
14 |
|
15 |
-
mr = project.get_model_registry(
|
16 |
model = mr.get_model("iris_modal", version=1)
|
17 |
model_dir = model.download()
|
18 |
model = joblib.load(model_dir + "/iris_model.pkl")
|
|
|
12 |
fs = project.get_feature_store()
|
13 |
|
14 |
|
15 |
+
mr = project.get_model_registry()
|
16 |
model = mr.get_model("iris_modal", version=1)
|
17 |
model_dir = model.download()
|
18 |
model = joblib.load(model_dir + "/iris_model.pkl")
|
huggingface-spaces-iris-monitor/.hw_api_key
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
UVRgRNenmo1JCsAe.u88x5fukWdRABp8x0qoIynyvacFzoggWCv8sXp5L9waMpsmVpEtOGgD5J8Ds3NM5
|
|
|
|
huggingface-spaces-iris-monitor/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Iris Monitoring
|
3 |
-
emoji: 💻
|
4 |
-
colorFrom: blue
|
5 |
-
colorTo: pink
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.8.2
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: apache-2.0
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
huggingface-spaces-iris-monitor/app.py
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from PIL import Image
|
3 |
-
import hopsworks
|
4 |
-
|
5 |
-
project = hopsworks.login()
|
6 |
-
fs = project.get_feature_store()
|
7 |
-
|
8 |
-
dataset_api = project.get_dataset_api()
|
9 |
-
|
10 |
-
dataset_api.download("Resources/images/latest_iris.png")
|
11 |
-
dataset_api.download("Resources/images/actual_iris.png")
|
12 |
-
dataset_api.download("Resources/images/df_recent.png")
|
13 |
-
dataset_api.download("Resources/images/confusion_matrix.png")
|
14 |
-
|
15 |
-
with gr.Blocks() as demo:
|
16 |
-
with gr.Row():
|
17 |
-
with gr.Column():
|
18 |
-
gr.Label("Today's Predicted Image")
|
19 |
-
input_img = gr.Image("latest_iris.png", elem_id="predicted-img")
|
20 |
-
with gr.Column():
|
21 |
-
gr.Label("Today's Actual Image")
|
22 |
-
input_img = gr.Image("actual_iris.png", elem_id="actual-img")
|
23 |
-
with gr.Row():
|
24 |
-
with gr.Column():
|
25 |
-
gr.Label("Recent Prediction History")
|
26 |
-
input_img = gr.Image("df_recent.png", elem_id="recent-predictions")
|
27 |
-
with gr.Column():
|
28 |
-
gr.Label("Confusion Maxtrix with Historical Prediction Performance")
|
29 |
-
input_img = gr.Image("confusion_matrix.png", elem_id="confusion-matrix")
|
30 |
-
|
31 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
huggingface-spaces-iris-monitor/requirements.txt
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
hopsworks
|
|
|
|
huggingface-spaces-iris/.hw_api_key
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
UVRgRNenmo1JCsAe.u88x5fukWdRABp8x0qoIynyvacFzoggWCv8sXp5L9waMpsmVpEtOGgD5J8Ds3NM5
|
|
|
|
huggingface-spaces-iris/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Iris
|
3 |
-
emoji: 🐢
|
4 |
-
colorFrom: purple
|
5 |
-
colorTo: green
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.5
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: apache-2.0
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
huggingface-spaces-iris/app.py
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import numpy as np
|
3 |
-
from PIL import Image
|
4 |
-
import requests
|
5 |
-
|
6 |
-
import hopsworks
|
7 |
-
import joblib
|
8 |
-
|
9 |
-
project = hopsworks.login()
|
10 |
-
fs = project.get_feature_store()
|
11 |
-
|
12 |
-
|
13 |
-
mr = project.get_model_registry()
|
14 |
-
model = mr.get_model("iris_modal", version=1)
|
15 |
-
model_dir = model.download()
|
16 |
-
model = joblib.load(model_dir + "/iris_model.pkl")
|
17 |
-
|
18 |
-
|
19 |
-
def iris(sepal_length, sepal_width, petal_length, petal_width):
|
20 |
-
input_list = []
|
21 |
-
input_list.append(sepal_length)
|
22 |
-
input_list.append(sepal_width)
|
23 |
-
input_list.append(petal_length)
|
24 |
-
input_list.append(petal_width)
|
25 |
-
# 'res' is a list of predictions returned as the label.
|
26 |
-
res = model.predict(np.asarray(input_list).reshape(1, -1))
|
27 |
-
# We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
|
28 |
-
# the first element.
|
29 |
-
flower_url = "https://raw.githubusercontent.com/featurestoreorg/serverless-ml-course/main/src/01-module/assets/" + res[0] + ".png"
|
30 |
-
img = Image.open(requests.get(flower_url, stream=True).raw)
|
31 |
-
return img
|
32 |
-
|
33 |
-
demo = gr.Interface(
|
34 |
-
fn=iris,
|
35 |
-
title="Iris Flower Predictive Analytics",
|
36 |
-
description="Experiment with sepal/petal lengths/widths to predict which flower it is.",
|
37 |
-
allow_flagging="never",
|
38 |
-
inputs=[
|
39 |
-
gr.inputs.Number(default=1.0, label="sepal length (cm)"),
|
40 |
-
gr.inputs.Number(default=1.0, label="sepal width (cm)"),
|
41 |
-
gr.inputs.Number(default=1.0, label="petal length (cm)"),
|
42 |
-
gr.inputs.Number(default=1.0, label="petal width (cm)"),
|
43 |
-
],
|
44 |
-
outputs=gr.Image(type="pil"))
|
45 |
-
|
46 |
-
demo.launch()
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
huggingface-spaces-iris/requirements.txt
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
hopsworks
|
2 |
-
joblib
|
3 |
-
scikit-learn
|
|
|
|
|
|
|
|