Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def deploy_app(model):
|
2 |
+
"""Deploy the model using Gradio."""
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
def predict(data_file):
|
6 |
+
data = pd.read_csv(data_file)
|
7 |
+
predictions = model.predict(data.drop(columns=['date']))
|
8 |
+
return pd.DataFrame({'Predicted Price': predictions})
|
9 |
+
|
10 |
+
interface = gr.Interface(
|
11 |
+
fn=predict,
|
12 |
+
inputs=gr.File(label="Upload CSV File"),
|
13 |
+
outputs="dataframe",
|
14 |
+
title="Electricity Price Prediction"
|
15 |
+
)
|
16 |
+
interface.launch()
|