import gradio as gr import os key = os.environ.get("var") # text = "it works!" def function(str): return key iface = gr.Interface(fn=function, inputs="text", outputs="text") iface.launch()