Spaces:
Runtime error
Runtime error
Download app.py from DeepAI123/renewable-energy-forecasting: direct link, hf CLI and curl.
- Browser
- Download file 901 Bytes
-
https://huggingface.co/spaces/DeepAI123/renewable-energy-forecasting/resolve/main/app.py
- Command line
-
hf download hf://spaces/DeepAI123/renewable-energy-forecasting/app.py
-
curl -L -o app.py https://huggingface.co/spaces/DeepAI123/renewable-energy-forecasting/resolve/main/app.py
901 Bytes
| import gradio as gr | |
| def predict(temp, humidity, wind, cloud): | |
| # Simple calculation | |
| base_power = 10 | |
| cloud_factor = (100 - cloud) / 100 | |
| result = base_power * cloud_factor | |
| return f""" | |
| ⚡ SOLAR POWER FORECAST | |
| Weather Input: | |
| - Temperature: {temp}°C | |
| - Humidity: {humidity}% | |
| - Wind Speed: {wind} m/s | |
| - Cloud Cover: {cloud}% | |
| Prediction: | |
| - Estimated Power: {result:.2f} kW | |
| - Status: System Running ✅ | |
| """ | |
| interface = gr.Interface( | |
| fn=predict, | |
| inputs=[ | |
| gr.Slider(min=-10, max=50, value=25, label="Temperature (°C)"), | |
| gr.Slider(min=0, max=100, value=65, label="Humidity (%)"), | |
| gr.Slider(min=0, max=25, value=5, label="Wind Speed (m/s)"), | |
| gr.Slider(min=0, max=100, value=40, label="Cloud Cover (%)") | |
| ], | |
| outputs="text", | |
| title="⚡ Solar Power Forecasting", | |
| description="ML model predicting solar output" | |
| ) | |
| interface.launch() |