Spaces:
Build error
Build error
daniel-rdt
commited on
Commit
•
c05c5fe
1
Parent(s):
afa3dfd
update in app interface
Browse files
app.py
CHANGED
@@ -1,8 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import imageio.v3 as iio
|
3 |
-
from PIL import Image
|
4 |
import hopsworks
|
5 |
-
import requests
|
6 |
|
7 |
project = hopsworks.login(api_key_value='U6PiDFwDVDQHP26X.XhXDZQ9QKiNwafhLh11PUntcyYW5Zp8aoXhoj1IJTGHDBu8owQJUKbFClHaehyMU')
|
8 |
fs = project.get_feature_store()
|
@@ -13,15 +11,12 @@ dataset_api.download("Resources/images/latest_bitcoin_fluctuation_prediction.png
|
|
13 |
dataset_api.download("Resources/images/latest_bitcoin_fluctuation_actual.png", overwrite=True)
|
14 |
dataset_api.download("Resources/images/df_recent.png", overwrite=True)
|
15 |
dataset_api.download("Resources/images/confusion_matrix.png", overwrite=True)
|
16 |
-
btc_7D_img = Image.open(requests.get('https://www.coindesk.com/embedded-chart/tTgdTNhtkB8N6/', stream=True).raw)
|
17 |
-
btc_7D_img.save("bitcoin-chart-7D.png")
|
18 |
|
19 |
def update():
|
20 |
dataset_api.download("Resources/images/latest_bitcoin_fluctuation_prediction.png", overwrite=True)
|
21 |
dataset_api.download("Resources/images/latest_bitcoin_fluctuation_actual.png", overwrite=True)
|
22 |
dataset_api.download("Resources/images/df_recent.png", overwrite=True)
|
23 |
dataset_api.download("Resources/images/confusion_matrix.png", overwrite=True)
|
24 |
-
btc_7D_img = Image.open(requests.get('https://www.coindesk.com/embedded-chart/tTgdTNhtkB8N6/', stream=True).raw)
|
25 |
|
26 |
def update_fluctuation_prediction_img():
|
27 |
im_pred = iio.imread('latest_bitcoin_fluctuation_prediction.png')
|
@@ -39,14 +34,8 @@ def update_confusion_matrix_img():
|
|
39 |
im_matr = iio.imread('confusion_matrix.png')
|
40 |
return im_matr
|
41 |
|
42 |
-
def update_btc_image():
|
43 |
-
btc_7D_img = iio.imread('bitcoin-chart-7D.png')
|
44 |
-
return btc_7D_img
|
45 |
-
|
46 |
with gr.Blocks() as demo:
|
47 |
-
|
48 |
-
btc_7D_img = gr.Image("bitcoin-chart-7D.png", elem_id="actual-img")
|
49 |
-
refresh.click(update_btc_image, outputs=btc_7D_img)
|
50 |
with gr.Row():
|
51 |
load=gr.Button("Load Images")
|
52 |
load.click(fn=update)
|
|
|
1 |
import gradio as gr
|
2 |
import imageio.v3 as iio
|
|
|
3 |
import hopsworks
|
|
|
4 |
|
5 |
project = hopsworks.login(api_key_value='U6PiDFwDVDQHP26X.XhXDZQ9QKiNwafhLh11PUntcyYW5Zp8aoXhoj1IJTGHDBu8owQJUKbFClHaehyMU')
|
6 |
fs = project.get_feature_store()
|
|
|
11 |
dataset_api.download("Resources/images/latest_bitcoin_fluctuation_actual.png", overwrite=True)
|
12 |
dataset_api.download("Resources/images/df_recent.png", overwrite=True)
|
13 |
dataset_api.download("Resources/images/confusion_matrix.png", overwrite=True)
|
|
|
|
|
14 |
|
15 |
def update():
|
16 |
dataset_api.download("Resources/images/latest_bitcoin_fluctuation_prediction.png", overwrite=True)
|
17 |
dataset_api.download("Resources/images/latest_bitcoin_fluctuation_actual.png", overwrite=True)
|
18 |
dataset_api.download("Resources/images/df_recent.png", overwrite=True)
|
19 |
dataset_api.download("Resources/images/confusion_matrix.png", overwrite=True)
|
|
|
20 |
|
21 |
def update_fluctuation_prediction_img():
|
22 |
im_pred = iio.imread('latest_bitcoin_fluctuation_prediction.png')
|
|
|
34 |
im_matr = iio.imread('confusion_matrix.png')
|
35 |
return im_matr
|
36 |
|
|
|
|
|
|
|
|
|
37 |
with gr.Blocks() as demo:
|
38 |
+
|
|
|
|
|
39 |
with gr.Row():
|
40 |
load=gr.Button("Load Images")
|
41 |
load.click(fn=update)
|