import gradio as gr # Function for the Hello World interface hello_world = gr.Interface(lambda name: "Hello " + name, "text", "text") # Function for the Should we translate? interface def check_input(input_string): if not input_string.strip(): return "No words in the input." words = input_string.split() response = [f"'{word}' is a valid word." if word.isalpha() and ' ' not in word else f"'{word}' is not a valid word." for word in words] return " ".join(response) should_we_translate = gr.Interface(check_input, "text", "text") # Creating a Tabbed Interface without the Statistics tab demo = gr.TabbedInterface([hello_world, should_we_translate], ["Hello World", "Should we translate?"]) if __name__ == "__main__": demo.launch()