Spaces:
No application file
No application file
Download app.py from AliHamza123/deploybert: direct link, hf CLI and curl.
- Browser
- Download file 581 Bytes
-
https://huggingface.co/spaces/AliHamza123/deploybert/resolve/main/app.py
- Command line
-
hf download hf://spaces/AliHamza123/deploybert/app.py
-
curl -L -o app.py https://huggingface.co/spaces/AliHamza123/deploybert/resolve/main/app.py
581 Bytes
| from flask import Flask, request, jsonify | |
| app = Flask(__name__) | |
| def upload_file(): | |
| if 'file' not in request.files: | |
| return jsonify({'error': 'No file part'}), 400 | |
| file = request.files['file'] | |
| if file.filename == '': | |
| return jsonify({'error': 'No selected file'}), 400 | |
| if file: | |
| # Process the file here (e.g., read its content, save it, etc.) | |
| content = file.read().decode('utf-8') | |
| # For example, let's just return the content as a response | |
| return jsonify({'content': content}) | |