Spaces:
Sleeping
Sleeping
samir72
commited on
Commit
·
4a2be07
1
Parent(s):
a697497
Add logs to app
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import os
|
|
| 2 |
import base64
|
| 3 |
import tempfile
|
| 4 |
import requests
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
from dotenv import load_dotenv
|
| 7 |
from openai import AzureOpenAI # official OpenAI SDK, works with Azure endpoints
|
|
@@ -50,7 +51,7 @@ def summarize_audio_b64(audio_b64: str, sys_prompt: str, user_prompt: str) -> st
|
|
| 50 |
},
|
| 51 |
],
|
| 52 |
)
|
| 53 |
-
|
| 54 |
return response.choices[0].message.content
|
| 55 |
|
| 56 |
except Exception as ex:
|
|
|
|
| 2 |
import base64
|
| 3 |
import tempfile
|
| 4 |
import requests
|
| 5 |
+
from datetime import datetime
|
| 6 |
import gradio as gr
|
| 7 |
from dotenv import load_dotenv
|
| 8 |
from openai import AzureOpenAI # official OpenAI SDK, works with Azure endpoints
|
|
|
|
| 51 |
},
|
| 52 |
],
|
| 53 |
)
|
| 54 |
+
print(f"Azure API call at {datetime.now()}: prompt_length={len(user_prompt)}, audio_size={len(audio_b64)}")
|
| 55 |
return response.choices[0].message.content
|
| 56 |
|
| 57 |
except Exception as ex:
|