Create test_api.py
Browse files- test_api.py +14 -0
test_api.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
|
3 |
+
RENDER_API_URL = "https://saivahini.onrender.com/process_audio"
|
4 |
+
|
5 |
+
# ✅ Load a sample audio file (Make sure you upload `test.wav` in HF Spaces)
|
6 |
+
audio_file_path = "test.wav"
|
7 |
+
|
8 |
+
# ✅ Send a test request to Render API
|
9 |
+
with open(audio_file_path, "rb") as audio_file:
|
10 |
+
response = requests.post(RENDER_API_URL, files={"file": ("test.wav", audio_file, "audio/wav")})
|
11 |
+
|
12 |
+
# ✅ Print the response
|
13 |
+
print("Status Code:", response.status_code)
|
14 |
+
print("Response:", response.json())
|