Spaces:
Runtime error
Runtime error
Download app.py from Yuning0123/test: direct link, hf CLI and curl.
- Browser
- Download file 397 Bytes
-
https://huggingface.co/spaces/Yuning0123/test/resolve/main/app.py
- Command line
-
hf download hf://spaces/Yuning0123/test/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Yuning0123/test/resolve/main/app.py
397 Bytes
| 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() | |