File size: 335 Bytes
cbc9feb
 
 
5a7d26a
 
 
 
 
 
 
cbc9feb
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr

def convert_to_fahrenheit(celsius):
    try:
        celsius = float(celsius)
        fahrenheit = celsius * 9/5 + 32
        return f"{fahrenheit} °F"
    except ValueError:
        return "Please enter a valid number."

demo = gr.Interface(fn=convert_to_fahrenheit, inputs="text", outputs="text")

demo.launch()