Doubleupai commited on
Commit
2c5f76f
·
verified ·
1 Parent(s): 7581cbb

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def convert_to_txt(file):
4
+ with open(file.name, 'r') as f:
5
+ content = f.read()
6
+ return content
7
+
8
+ iface = gr.Interface(
9
+ fn=convert_to_txt,
10
+ inputs=gr.File(label="Select a file (.gitattributes, .gitignore, .md, .py)"),
11
+ outputs="text",
12
+ title="huggingfile",
13
+ description="Upload a file and click the button to generate the text from the file."
14
+ )
15
+
16
+ iface.launch()