Spaces:
Build error
Build error
Download app.py from Madhuritha/Lab04: direct link, hf CLI and curl.
- Browser
- Download file 908 Bytes
-
https://huggingface.co/spaces/Madhuritha/Lab04/resolve/main/app.py
- Command line
-
hf download hf://spaces/Madhuritha/Lab04/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Madhuritha/Lab04/resolve/main/app.py
908 Bytes
| import gradio as gr | |
| # Feature 1: longitude, in a range between -100,100 | |
| input_module1= gr.Number(label='longitude') | |
| # Feature 2: latitude, in a range between -100,100 | |
| input_module2= gr.Number(label='latitude') | |
| # Feature 3: population, numeric value between 0, 100 | |
| input_module3= gr.Number(label='population') | |
| # Feature 4: income level, categorical values with low, median , high | |
| input_module4= gr.Dropdown(choices=['low', 'medium', 'high'], label='income level') | |
| ## outputs: | |
| # price: numeric value | |
| output_module=gr.Number(label='predicted house value') | |
| ## design a random function accepts four features and output any random value | |
| def process_inputs(input1, input2, input3, input4): | |
| output = 1 | |
| return output | |
| demo=gr.Interface(fn= process_inputs, | |
| inputs=[input_module1, input_module2, input_module3, input_module4], | |
| outputs=output_module).launch(debug=True) | |
| demo.launch() | |