basel-weather / predict.py
jonwiese
new model
9ee44bd
raw
history blame
608 Bytes
import gradio as gr
from weatherpredictor import WeatherPredictor
# Initialize the predictor
predictor = WeatherPredictor('Basel2019-2024.csv')
predictor.load_model('weather_predictor.pth')
#@spaces.GPU
def predict_weather(input_date):
result = predictor.predict(input_date)
return result
# Create Gradio interface
app = gr.Interface(
fn=predict_weather,
inputs=gr.Textbox(label="Enter Date (dd/mm/yy)"),
outputs=[gr.JSON()],
title="Weather Predictor",
description="Enter a date to get weather predictions."
)
# Launch the interface
if __name__ == "__main__":
app.launch()