Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
@@ -24,7 +24,7 @@ def transcribe_audio(audio_path, language="English"):
|
|
24 |
result = model.transcribe(audio_path, language=language.lower())
|
25 |
return result['text']
|
26 |
|
27 |
-
def
|
28 |
"""
|
29 |
Save uploaded audio to a file.
|
30 |
"""
|
@@ -40,4 +40,4 @@ def save_chat_history(history, filename="chat_history.json"):
|
|
40 |
"""
|
41 |
os.makedirs("history", exist_ok=True)
|
42 |
with open(os.path.join("history", filename), "w") as f:
|
43 |
-
json.dump(history, f, indent=4)
|
|
|
24 |
result = model.transcribe(audio_path, language=language.lower())
|
25 |
return result['text']
|
26 |
|
27 |
+
def save_uploaded_audio(uploaded_file, filename):
|
28 |
"""
|
29 |
Save uploaded audio to a file.
|
30 |
"""
|
|
|
40 |
"""
|
41 |
os.makedirs("history", exist_ok=True)
|
42 |
with open(os.path.join("history", filename), "w") as f:
|
43 |
+
json.dump(history, f, indent=4)
|