Spaces:
Sleeping
Sleeping
File size: 909 Bytes
43106f9 46779f8 43106f9 46779f8 114a7d7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
import modal
app = modal.App('scheduler')
@app.function(schedule=modal.Period(seconds=10))
def update():
print('Updating...')
# Send dataframe to Streamlit frontend
@app.function()
def predict():
# Extract features
# Run model
print('Predicting...')
"""
project = hopsworks.login(project=project_name, api_key_value=api_key)
fs = project.get_feature_store()
secrets = util.secrets_api(project.name)
AQI_API_KEY = secrets.get_secret("AQI_API_KEY").value
location_str = secrets.get_secret("SENSOR_LOCATION_JSON").value
location = json.loads(location_str)
country=location['country']
city=location['city']
street=location['street']
aqicn_url=location['aqicn_url']
latitude=location['latitude']
longitude=location['longitude']
today = datetime.date.today()
# Retrieve feature groups
air_quality_fg = fs.get_feature_group(
name='air_quality',
version=1,
)
""" |