DeepAI123's picture
Update app.py
be1483e verified
Raw History Blame Contribute Delete
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()