Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -136,6 +136,7 @@ with rl:
|
|
| 136 |
with st.spinner("Transcribing..."):
|
| 137 |
#transcription = transcribe("temp_recording.wav")
|
| 138 |
#need to send the data here
|
|
|
|
| 139 |
st.text_area("Transcription", transcription, height=200)
|
| 140 |
else:
|
| 141 |
st.error("Please record audio or upload a file to transcribe.")
|
|
@@ -146,9 +147,12 @@ with right:
|
|
| 146 |
# Box 4: Form 3
|
| 147 |
prompt3 = st.text_input("Enter Prompt", key="prompt3")
|
| 148 |
#image_url3 = st.text_input("Enter Image URL", key="image_url3")
|
| 149 |
-
if st.button("Submit
|
| 150 |
payload = {"prompt": prompt3}
|
| 151 |
-
|
|
|
|
|
|
|
|
|
|
| 152 |
if response.status_code == 200:
|
| 153 |
st.write(f"**Response:** {response.json().get('response', 'No response')}")
|
| 154 |
else:
|
|
|
|
| 136 |
with st.spinner("Transcribing..."):
|
| 137 |
#transcription = transcribe("temp_recording.wav")
|
| 138 |
#need to send the data here
|
| 139 |
+
print("")
|
| 140 |
st.text_area("Transcription", transcription, height=200)
|
| 141 |
else:
|
| 142 |
st.error("Please record audio or upload a file to transcribe.")
|
|
|
|
| 147 |
# Box 4: Form 3
|
| 148 |
prompt3 = st.text_input("Enter Prompt", key="prompt3")
|
| 149 |
#image_url3 = st.text_input("Enter Image URL", key="image_url3")
|
| 150 |
+
if st.button("Submit", key="submit3"):
|
| 151 |
payload = {"prompt": prompt3}
|
| 152 |
+
headers = {
|
| 153 |
+
"Authorization": f"Api-Key {BASETEN_KEY}"
|
| 154 |
+
}
|
| 155 |
+
response = requests.post(f"{BASETEN_API}", headers=headers, json=payload)
|
| 156 |
if response.status_code == 200:
|
| 157 |
st.write(f"**Response:** {response.json().get('response', 'No response')}")
|
| 158 |
else:
|