Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -33,10 +33,11 @@ from templates import css, bot_template, user_template
|
|
33 |
|
34 |
def generate_filename(prompt, file_type):
|
35 |
central = pytz.timezone('US/Central')
|
36 |
-
safe_date_time = datetime.now(central).strftime("%m%d_%
|
37 |
safe_prompt = "".join(x for x in prompt if x.isalnum())[:90] # Limit file name size and trim whitespace
|
38 |
return f"{safe_date_time}_{safe_prompt}.{file_type}" # Return a safe file name
|
39 |
|
|
|
40 |
def transcribe_audio(openai_key, file_path, model):
|
41 |
OPENAI_API_URL = "https://api.openai.com/v1/audio/transcriptions"
|
42 |
headers = {
|
|
|
33 |
|
34 |
def generate_filename(prompt, file_type):
|
35 |
central = pytz.timezone('US/Central')
|
36 |
+
safe_date_time = datetime.now(central).strftime("%m%d_%H%M") # Date and time DD-HHMM
|
37 |
safe_prompt = "".join(x for x in prompt if x.isalnum())[:90] # Limit file name size and trim whitespace
|
38 |
return f"{safe_date_time}_{safe_prompt}.{file_type}" # Return a safe file name
|
39 |
|
40 |
+
|
41 |
def transcribe_audio(openai_key, file_path, model):
|
42 |
OPENAI_API_URL = "https://api.openai.com/v1/audio/transcriptions"
|
43 |
headers = {
|