File size: 409 Bytes
2c5f76f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()