Spaces:
Runtime error
Runtime error
import gradio as gr | |
import pandas as pd | |
import numpy as np | |
def greet(year,co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission): | |
data1=pd.read_excel("FINAL_DATASET.xlsx") | |
df1 = data1.drop(['YEAR'], axis=1) | |
x=df1.iloc[:,1:].values | |
y=df1.iloc[:,0].values | |
np.reshape(y,(-1,1)) | |
from sklearn.model_selection import train_test_split | |
X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.33, random_state=42) | |
from sklearn.linear_model import LinearRegression | |
reg = LinearRegression().fit(X_train, y_train) | |
#Equation | |
total1="2.29209688*(x1)+(-17.24834114)*(x2)+(-34.46449984)*(x3)+441.88734541*(x4)+(-10.5704468)*(x5)+3032.3276611889232" | |
eq1=2.29209688*(co2_emission)+(-17.24834114)*(No2_emission)+(-34.46449984)*(so2_emission)+441.88734541*(Global_Warming)+(-10.5704468)*(Methane_emission)+3032.3276611889232 | |
if(year==1996): | |
return total1,eq1 | |
demo = gr.Interface( | |
fn=greet, | |
inputs=["number","number","number","number","number","number"], | |
outputs=["text","number"], | |
title="BARA SHIGRI", | |
css="div {background-image: url('https://drive.google.com/uc?export=view&id=1o4Q6O7LAFTpejs4zwOo6X-BYfrjjyTVr');background-size: 2000px 2000px;}", | |
description= | |
"Bara Shigri feeds the Chandra River which after its confluence at Tandi with the Bhaga River is known as Chandrabhaga or Chenab." | |
"According to Hugh Whistler’s 1924 writing, Shigri is applied par-excellence to one particular glacier that emerges from the mountains on the left bank of the Chenab. It is said to be several miles long, and the snout reaches right down to the river, lying athwart the customary road from Kulu to Spiti... In 1836 this glacier dammed the Chenab River, causing the formation of a large lake, which eventually broke loose and carried devastation down the valley." | |
"Across the Bara Shigri is another glacier known as Chhota Shigri. It is, as the name suggests, a comparatively smaller glacier.", | |
description_font_color="Black" | |
) | |
demo.launch(inline=False) |