Download server.py from EdenSw/Vid2Sum: direct link, hf CLI and curl.
- Browser
- Download file 531 Bytes
-
https://huggingface.co/EdenSw/Vid2Sum/resolve/main/server.py
- Command line
-
hf download hf://EdenSw/Vid2Sum/server.py
-
curl -L -o server.py https://huggingface.co/EdenSw/Vid2Sum/resolve/main/server.py
531 Bytes
| from flask import Flask, request, jsonify | |
| from summarize import Vid2Sum | |
| app = Flask(__name__) | |
| def predict(): | |
| # Check if video file is included in the request | |
| if 'video' not in request.files: | |
| return jsonify({'error': 'No video file found'}), 400 | |
| video_file = request.files['video'] | |
| # Perform video-to-text conversion using your existing code | |
| text_output = Vid2Sum(video_file) | |
| return jsonify({'text': text_output}) | |
| if __name__ == '__main__': | |
| app.run() | |