eaglelandsonce commited on
Commit
a9d577e
·
verified ·
1 Parent(s): 47b3ba1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -12
app.py CHANGED
@@ -15,8 +15,8 @@ import google.generativeai as genai
15
 
16
  api_key = os.environ["OPENAI_API_KEY"]
17
  from openai import OpenAI
18
-
19
-
20
 
21
  import numpy as np
22
  # Assuming chromadb and TruLens are correctly installed and configured
@@ -164,7 +164,7 @@ color_codes = {
164
 
165
  #text +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
166
 
167
- query = """ On his first day at Quantum Data Institute in Green Open Data City Aya, Elian marveled at the city’s harmonious blend of technology and nature.
168
  Guided to his mentor, Dr. Maya Lior, a pioneer in urban data ecosystems, their discussion quickly centered on Aya’s innovative design.
169
  Dr. Lior explained data analytics and green technologies were intricately woven into the city's infrastructure, and how they used
170
  a Custom GPT called Green Data City to create the design.
@@ -241,14 +241,6 @@ with tab1:
241
  st.markdown(query)
242
 
243
  # Displaying the audio player below the text
244
- # Initialize OpenAI client and create embeddings
245
- oai_client = OpenAI()
246
- oai_client.embeddings.create(
247
- model="text-embedding-ada-002",
248
- input=query
249
- )
250
-
251
-
252
  voice_option = st.selectbox(
253
  'Choose a voice:',
254
  ['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer']
@@ -260,7 +252,7 @@ with tab1:
260
  response = oai_client.audio.speech.create(
261
  model="tts-1",
262
  voice=voice_option,
263
- input=query,
264
  )
265
 
266
  # Stream or save the response as needed
 
15
 
16
  api_key = os.environ["OPENAI_API_KEY"]
17
  from openai import OpenAI
18
+ # Initialize OpenAI client and create embeddings
19
+ oai_client = OpenAI()
20
 
21
  import numpy as np
22
  # Assuming chromadb and TruLens are correctly installed and configured
 
164
 
165
  #text +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
166
 
167
+ intro_text = """ On his first day at Quantum Data Institute in Green Open Data City Aya, Elian marveled at the city’s harmonious blend of technology and nature.
168
  Guided to his mentor, Dr. Maya Lior, a pioneer in urban data ecosystems, their discussion quickly centered on Aya’s innovative design.
169
  Dr. Lior explained data analytics and green technologies were intricately woven into the city's infrastructure, and how they used
170
  a Custom GPT called Green Data City to create the design.
 
241
  st.markdown(query)
242
 
243
  # Displaying the audio player below the text
 
 
 
 
 
 
 
 
244
  voice_option = st.selectbox(
245
  'Choose a voice:',
246
  ['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer']
 
252
  response = oai_client.audio.speech.create(
253
  model="tts-1",
254
  voice=voice_option,
255
+ input=intro_text,
256
  )
257
 
258
  # Stream or save the response as needed