Spaces:
Runtime error
Runtime error
import gradio as gr | |
input_1 = gr.inputs.Textbox(label = "Input Text") | |
input_2 = gr.inputs.Image(label = "Input Image") | |
output_1 = gr.outputs.Textbox(label = "Predicted Housing Prices") | |
output_2 = gr.outputs.Image(label = "Visualization of the location") | |
input_longitude = gr.inputs.Slider(-124.35, 114.35, step=1, label = "Longitude") | |
input_latitude = gr.inputs.Slider(32, 41, step=1, label = "Latitude") | |
input_housing_median = gr.inputs.Slider(1, 52, step=1, label = "Housing_median") | |
input_total_rooms = gr.inputs.Slider(1, 39996, step=1, label = "Total_rooms") | |
input_total_bedrooms = gr.inputs.Slider(1, 6441, step=1, label = "Total_bedrooms") | |
input_population = gr.inputs.Slider(10, 35678, step=1, label = "Population") | |
input_households = gr.inputs.Slider(10, 6081, step=1, label = "Households") | |
input_median_income = gr.inputs.Slider(0, 15, step=0.1, label = "Median_income") | |
def multi_inputs(input_longitude, input_latitude, input_housing_median, input_total_rooms, input_total_bedrooms, input_population, input_households, input_median_income): | |
import numpy as np | |
import pandas as pd | |
output1 = "Processing inputs and return outputs" | |
output2 = np.random.rand(6,6) | |
return output1,output2 | |
gr.Interface(fn=multi_inputs, inputs=[input_longitude, input_latitude, input_housing_median, input_total_rooms, input_total_bedrooms, input_population, input_households, input_median_income], | |
outputs=[output_1, output_2] | |
).launch() |