Spaces:
Runtime error
Runtime error
Update app.py
Browse files10 unmodified lines111213141516171819202122232425262728293031323334353610 unmodified linesprediction = model.predict(inputs)prediction_value = prediction[0][0] # Assuming the prediction is a scalarresult = "Income_bracket lesser than or equal to 50K" if prediction_value <= 0.5 else "Income_bracket greater than 50K"return f"Income_bracket Prediction: {prediction_value} \n\nResult: {result}"# Create the Gradio interfacesalarybracket_ga = gr.Interface(fn=salarybracket,inputs = [gr.Number(13.0, 84.0, label="Age: [13 to 84]"),gr.Number(1.0, 28.0, label="workclass: [1 to 28]"),gr.Number(10.0, 32.0, label="education: [10 to 32]"),gr.Number(0.0, 11.0, label="education_num: [0 to 11]"),gr.Number(0.0, 1.0, label="marital_status: [0 or 1]"),gr.Number(0.0, 37.0, label="occupation: [0 to 37]"),gr.Number(0.0, 37.0, label="relationship: [0 to 37]"),gr.Number(0.0, 1.0, label="race: [0 or 1]"),gr.Number(0.0, 30.0, label="gender: [0 to 30]"),gr.Number(0.0, 1.0, label="capital_gain: [0 or 1]"),gr.Number(0.0, 19.0, label="capital_loss: [0.0 19.0]"),gr.Number(0.0, 1.0, label="hours_per_week: [0 or 1]"),gr.Number(0.0, 1.0, label="native_country: [0 or 1]"),],outputs="text", title="Salary Bracket Prediction",examples = [[75,0,0,6,6,0,2,1,0,0,0,1,3,0,0],10 unmodified lines111213141516171819202122232425262728293031323334353610 unmodified linesprediction = model.predict(inputs)prediction_value = prediction[0][0] # Assuming the prediction is a scalarresult = "Income_bracket lesser than or equal to 50K" if prediction_value <= 0.5 else "Income_bracket greater than 50K"return f"Result: {result}"# Create the Gradio interfacesalarybracket_ga = gr.Interface(fn=salarybracket,inputs = [gr.Number(17, 90, label="Age [17 to 90]"),gr.Number(0, 8, label="Workclass [0 to 8]"),gr.Number(0, 15, label="Education [0 to 15]"),gr.Number(1, 16, label="Education Num [1 to 16]"),gr.Number(0, 6, label="Marital Status [0 to 6]"),gr.Number(0, 14, label="Occupation [0 to 14]"),gr.Number(0, 5, label="Relationship [0 to 5]"),gr.Number(0, 4, label="Race [0 to 4]"),gr.Number(0, 1, label="Gender [0 to 1]"),gr.Number(0, 99999, label="Capital Gain [0 to 99999]"),gr.Number(0, 4356, label="Capital Loss [0 to 4356]"),gr.Number(1, 99, label="Hours per Week [1 to 99]"),gr.Number(0, 40, label="Native Country [0 to 40]"),]outputs="text", title="Salary Bracket Prediction",examples = [[75,0,0,6,6,0,2,1,0,0,0,1,3,0,0],
app.py+15-15