tilos commited on
Commit
8c2c3d2
·
1 Parent(s): 614ac0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -7,7 +7,7 @@ import requests
7
  import json
8
  import dateutil.parser as dp
9
  import pandas as pd
10
-
11
 
12
  def get_row():
13
  response_tomtom = requests.get(
@@ -50,7 +50,9 @@ def get_row():
50
  row.dropna(axis=0, inplace=True)
51
  return row
52
 
53
- model = joblib.load("./traffic_model.pkl")
 
 
54
 
55
  def infer(input_dataframe):
56
  return pd.DataFrame(model.predict(input_dataframe))
 
7
  import json
8
  import dateutil.parser as dp
9
  import pandas as pd
10
+ from huggingface_hub import hf_hub_url, cached_download
11
 
12
  def get_row():
13
  response_tomtom = requests.get(
 
50
  row.dropna(axis=0, inplace=True)
51
  return row
52
 
53
+ model = joblib.load(cached_download(
54
+ hf_hub_url(tilos/Traffic_Prediction, traffic_model.pkl)
55
+ ))
56
 
57
  def infer(input_dataframe):
58
  return pd.DataFrame(model.predict(input_dataframe))