| import gradio as gr | |
| import os | |
| def celsius_to_fahrenheit(celsius): | |
| return celsius * 9/5 + 32 | |
| demo = gr.Interface( | |
| fn=celsius_to_fahrenheit, | |
| inputs=gr.Number(label="Temperature in Celsius"), | |
| outputs=gr.Number(label="Temperature in Fahrenheit"), | |
| title="Celsius to Fahrenheit Converter" | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch() |