Chloe commited on
Commit
db5e913
·
1 Parent(s): f7ed60e
Files changed (2) hide show
  1. app.py +3 -3
  2. requirements.txt +2 -1
app.py CHANGED
@@ -68,10 +68,10 @@ def voice_transfer():
68
  # voice_file_path = os.path.join(temp_dir, file.filename)
69
  # file.save(voice_file_path)
70
  # 2. Check for file URL
71
- if 'voice_file_url' in request.form:
72
- file_url = request.form.get('voice_file_url')
73
  if not file_url:
74
- return jsonify({"error": "No voice_file_url provided"}), 400
75
  response = requests.get(file_url)
76
  if response.status_code != 200:
77
  return jsonify({"error": "Failed to download voice file from URL"}), 400
 
68
  # voice_file_path = os.path.join(temp_dir, file.filename)
69
  # file.save(voice_file_path)
70
  # 2. Check for file URL
71
+ if 'voice_file' in request.form:
72
+ file_url = request.form.get('voice_file')
73
  if not file_url:
74
+ return jsonify({"error": "No voice_file (URL) provided"}), 400
75
  response = requests.get(file_url)
76
  if response.status_code != 200:
77
  return jsonify({"error": "Failed to download voice file from URL"}), 400
requirements.txt CHANGED
@@ -4,4 +4,5 @@ beautifulsoup4
4
  ebooklib
5
  gunicorn
6
  fish-audio-sdk
7
- python-dotenv
 
 
4
  ebooklib
5
  gunicorn
6
  fish-audio-sdk
7
+ python-dotenv
8
+ pydub