sAIvahini / app.py
TruthLens's picture
Update app.py
950fbff verified
raw
history blame contribute delete
625 Bytes
import requests
import streamlit as st
# βœ… Render API URL
RENDER_API_URL = "https://saivahini.onrender.com/process_audio"
st.title("Test API from HF Spaces πŸš€")
# βœ… Load a sample test audio file (Make sure `test.wav` exists in HF Spaces)
test_audio_file = "test.wav"
try:
with open(test_audio_file, "rb") as audio_file:
response = requests.post(RENDER_API_URL, files={"file": ("test.wav", audio_file, "audio/wav")})
# βœ… Show API response
st.write("Status Code:", response.status_code)
st.write("Response:", response.text)
except Exception as e:
st.error(f"❌ API Test Failed: {e}")