sreepathi-ravikumar commited on
Commit
ba31dc4
·
verified ·
1 Parent(s): 263105f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,9 +1,10 @@
1
  from flask import Flask, send_file
 
2
  from video import video_generation
3
  import os
4
 
5
  app = Flask(__name__)
6
- VIDEO_FOLDER = os.path.abspath(".")
7
 
8
  @app.route('/get_video')
9
  def get_video():
@@ -39,8 +40,11 @@ def get_video():
39
  "plants supporting life on Earth"
40
  ]
41
 
42
- video_file = video_generation(text, prompts)
43
- return send_file(video_file, mimetype='video/mp4')
 
 
 
44
 
45
  if __name__ == '__main__':
46
  app.run(host='0.0.0.0', port=7860)
 
1
  from flask import Flask, send_file
2
+ from flask_cors import CORS
3
  from video import video_generation
4
  import os
5
 
6
  app = Flask(__name__)
7
+ CORS(app)
8
 
9
  @app.route('/get_video')
10
  def get_video():
 
40
  "plants supporting life on Earth"
41
  ]
42
 
43
+ video_url = f"https://sreepathi-ravikumar-backendprocess.hf.space/{os.path.basename(video_path)}"
44
+ return jsonify({"video_url": video_url})
45
+
46
+ # Construct URL (adjust domain/port if needed)
47
+
48
 
49
  if __name__ == '__main__':
50
  app.run(host='0.0.0.0', port=7860)