import gradio as gr def convert_to_txt(file): with open(file.name, 'r') as f: content = f.read() return content iface = gr.Interface( fn=convert_to_txt, inputs=gr.File(label="Select a file (.gitattributes, .gitignore, .md, .py)"), outputs="text", title="huggingfile", description="Upload a file and click the button to generate the text from the file." ) iface.launch()