import gradio as gr | |
import os | |
# Check if running on Hugging Face Spaces | |
is_hf_spaces = os.getenv("HF_SPACES", "false").lower() == "true" | |
def greet(name, intensity): | |
return "Hello, " + name + "!" * int(intensity) | |
demo = gr.Interface( | |
fn=greet, | |
inputs=["text", "slider"], | |
outputs=["text"], | |
) | |
demo.launch() | |