Spaces:
Sleeping
Sleeping
Mudassir939
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -25,8 +25,8 @@ aai.settings.api_key = ASSEMBLYAI_API_KEY
|
|
25 |
# Set Google API key for Gemini model
|
26 |
os.environ["GOOGLE_API_KEY"] = GOOGLE_API_KEY
|
27 |
|
28 |
-
# Define a directory to save uploaded audio files
|
29 |
-
UPLOAD_FOLDER = '
|
30 |
os.makedirs(UPLOAD_FOLDER, exist_ok=True)
|
31 |
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
|
32 |
|
@@ -46,10 +46,10 @@ Remember:
|
|
46 |
- Option 4 it is voice mail, make it option 4
|
47 |
"""
|
48 |
|
49 |
-
# Home route to serve the index.html file
|
50 |
@app.route('/')
|
51 |
def home():
|
52 |
-
return send_file('
|
53 |
|
54 |
# API route to handle file upload, transcription, and model interaction
|
55 |
@app.route("/api/upload", methods=["POST"])
|
@@ -110,7 +110,7 @@ def generate_api():
|
|
110 |
# Route to serve static files
|
111 |
@app.route('/<path:path>')
|
112 |
def serve_static(path):
|
113 |
-
return send_from_directory('
|
114 |
|
115 |
# Run the Flask application
|
116 |
if __name__ == '__main__':
|
|
|
25 |
# Set Google API key for Gemini model
|
26 |
os.environ["GOOGLE_API_KEY"] = GOOGLE_API_KEY
|
27 |
|
28 |
+
# Define a directory to save uploaded audio files
|
29 |
+
UPLOAD_FOLDER = 'uploads'
|
30 |
os.makedirs(UPLOAD_FOLDER, exist_ok=True)
|
31 |
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
|
32 |
|
|
|
46 |
- Option 4 it is voice mail, make it option 4
|
47 |
"""
|
48 |
|
49 |
+
# Home route to serve the index.html file from the root directory
|
50 |
@app.route('/')
|
51 |
def home():
|
52 |
+
return send_file('index.html')
|
53 |
|
54 |
# API route to handle file upload, transcription, and model interaction
|
55 |
@app.route("/api/upload", methods=["POST"])
|
|
|
110 |
# Route to serve static files
|
111 |
@app.route('/<path:path>')
|
112 |
def serve_static(path):
|
113 |
+
return send_from_directory('.', path)
|
114 |
|
115 |
# Run the Flask application
|
116 |
if __name__ == '__main__':
|