Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,9 @@ import base64
|
|
4 |
from PIL import Image
|
5 |
from io import BytesIO
|
6 |
import os
|
7 |
-
import pyttsx3
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
engine.say(text)
|
12 |
-
engine.runAndWait()
|
13 |
|
14 |
# Set the API key
|
15 |
os.environ["TOGETHER_API_KEY"] = "tgp_v1_ci8Tlva09oBrdDV89ULFNcyPgnR9NwNTQyvQ_4XBw3M"
|
@@ -96,6 +93,28 @@ st.markdown(
|
|
96 |
unsafe_allow_html=True,
|
97 |
)
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
# Streamlit app layout
|
100 |
st.title("๐ฎ Visox | Koshur AI")
|
101 |
st.markdown("### See the world through AI's eyes!")
|
@@ -123,7 +142,8 @@ if img_file_buffer is not None:
|
|
123 |
st.success('โ
Analysis complete!')
|
124 |
st.markdown("### AI Description:")
|
125 |
st.write(description)
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
|
4 |
from PIL import Image
|
5 |
from io import BytesIO
|
6 |
import os
|
|
|
7 |
|
8 |
+
|
9 |
+
|
|
|
|
|
10 |
|
11 |
# Set the API key
|
12 |
os.environ["TOGETHER_API_KEY"] = "tgp_v1_ci8Tlva09oBrdDV89ULFNcyPgnR9NwNTQyvQ_4XBw3M"
|
|
|
93 |
unsafe_allow_html=True,
|
94 |
)
|
95 |
|
96 |
+
def tts(text):
|
97 |
+
key = 'sk_8db078175c4eba3e2d4b500ffb167c46326e520bdf001f0e'
|
98 |
+
|
99 |
+
|
100 |
+
from elevenlabs.client import ElevenLabs
|
101 |
+
from elevenlabs import play
|
102 |
+
|
103 |
+
|
104 |
+
|
105 |
+
client = ElevenLabs(api_key=key)
|
106 |
+
|
107 |
+
|
108 |
+
audio = client.text_to_speech.convert(
|
109 |
+
text=text,
|
110 |
+
voice_id="JBFqnCBsd6RMkjVDRZzb",
|
111 |
+
model_id="eleven_multilingual_v2",
|
112 |
+
output_format="mp3_44100_128",
|
113 |
+
)
|
114 |
+
|
115 |
+
|
116 |
+
play(audio)
|
117 |
+
|
118 |
# Streamlit app layout
|
119 |
st.title("๐ฎ Visox | Koshur AI")
|
120 |
st.markdown("### See the world through AI's eyes!")
|
|
|
142 |
st.success('โ
Analysis complete!')
|
143 |
st.markdown("### AI Description:")
|
144 |
st.write(description)
|
145 |
+
|
146 |
+
tts(descripion)
|
147 |
+
|
148 |
+
|
149 |
+
|