Spaces:
Runtime error
Runtime error
| 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() | |