Spaces:
Runtime error
Runtime error
File size: 397 Bytes
8e340d0 c7c39a7 8e340d0 1b58834 c7c39a7 1b58834 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import gradio as gr
def process_files(files):
contents = []
for file in files:
with open(file.name, 'r') as f:
contents.append(f.read())
return "\n\n".join(contents)
demo = gr.Interface(
fn=process_files,
inputs=gr.File(label="拖拽文件到这里", type="file", file_count="multiple"),
outputs="text"
)
if __name__ == "__main__":
demo.launch()
|