Huggingfile / app.py
Doubleupai's picture
Create app.py
2c5f76f verified
Raw
History Blame Contribute Delete
409 Bytes
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()