shikharyashmaurya
commited on
Commit
•
26406e6
1
Parent(s):
00cdf6b
Update app.py
Browse files
app.py
CHANGED
@@ -73,7 +73,7 @@ audio_text=st.text_input("What do you want to know about the audio:")
|
|
73 |
|
74 |
if audio_text:
|
75 |
|
76 |
-
audio_prompt=""".You will be analyse the audio and provide the answers of the question given here: """+
|
77 |
|
78 |
|
79 |
audio_file = st.file_uploader("Upload an audio file", type=["mp3", "wav", "ogg"])
|
@@ -86,7 +86,7 @@ def generate_gemini_content(prompt,audio_file):
|
|
86 |
|
87 |
model = genai.GenerativeModel("models/gemini-1.5-pro-latest")
|
88 |
your_file = genai.upload_file(tmp_file.name)
|
89 |
-
response = model.generate_content([
|
90 |
return response.text
|
91 |
|
92 |
os.remove(tmp_file.name)
|
@@ -95,5 +95,5 @@ if st.button("Answer or summary"):
|
|
95 |
|
96 |
if audio_file:
|
97 |
summary=generate_gemini_content(prompt,audio_file)
|
98 |
-
st.markdown("##
|
99 |
st.write(summary)
|
|
|
73 |
|
74 |
if audio_text:
|
75 |
|
76 |
+
audio_prompt=""".You will be analyse the audio and provide the answers of the question given here: """+audio_text
|
77 |
|
78 |
|
79 |
audio_file = st.file_uploader("Upload an audio file", type=["mp3", "wav", "ogg"])
|
|
|
86 |
|
87 |
model = genai.GenerativeModel("models/gemini-1.5-pro-latest")
|
88 |
your_file = genai.upload_file(tmp_file.name)
|
89 |
+
response = model.generate_content([audio_prompt, your_file])
|
90 |
return response.text
|
91 |
|
92 |
os.remove(tmp_file.name)
|
|
|
95 |
|
96 |
if audio_file:
|
97 |
summary=generate_gemini_content(prompt,audio_file)
|
98 |
+
st.markdown("## Emotion/answer:")
|
99 |
st.write(summary)
|