Spaces:
Runtime error
Runtime error
Merlijn
commited on
Commit
•
c813d7d
1
Parent(s):
8b5f180
small update
Browse files
app.py
CHANGED
@@ -3,9 +3,23 @@ import plotly.graph_objects as go
|
|
3 |
import json
|
4 |
import requests
|
5 |
import os
|
|
|
|
|
|
|
|
|
6 |
|
7 |
API_KEY = os.getenv("API-KEY-TOMTOM")
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
api_params_incidents = {
|
10 |
'base_url': 'api.tomtom.com',
|
11 |
'API_KEY': "XyqEVsk8ELwIx6GGPMOqyAIE8dJ22vZM",
|
|
|
3 |
import json
|
4 |
import requests
|
5 |
import os
|
6 |
+
from PIL import Image
|
7 |
+
import hopsworks
|
8 |
+
import joblib
|
9 |
+
import pandas as pd
|
10 |
|
11 |
API_KEY = os.getenv("API-KEY-TOMTOM")
|
12 |
|
13 |
+
# Log into hopsworks
|
14 |
+
project = hopsworks.login()
|
15 |
+
fs = project.get_feature_store()
|
16 |
+
mr = project.get_model_registry()
|
17 |
+
|
18 |
+
model = mr.get_model("stockholm_incidents_model", version=1)
|
19 |
+
model_dir = model.download()
|
20 |
+
model = joblib.load(model_dir + "/stockholm_incidents_model.pkl")
|
21 |
+
print("Model downloaded")
|
22 |
+
|
23 |
api_params_incidents = {
|
24 |
'base_url': 'api.tomtom.com',
|
25 |
'API_KEY': "XyqEVsk8ELwIx6GGPMOqyAIE8dJ22vZM",
|