Spaces:
Sleeping
Sleeping
Alfie Grace
commited on
Commit
·
d8aa880
1
Parent(s):
e19d5ef
Hardcoded AWS keys and replaced news api and tmdb api with placeholders. Commented out talking head functionality
Browse files
app.py
CHANGED
@@ -40,10 +40,12 @@ from langchain.vectorstores.faiss import FAISS
|
|
40 |
from langchain.docstore.document import Document
|
41 |
from langchain.chains.question_answering import load_qa_chain
|
42 |
|
43 |
-
news_api_key = os.environ["NEWS_API_KEY"]
|
44 |
-
|
|
|
|
|
45 |
|
46 |
-
TOOLS_LIST = ['serpapi', 'wolfram-alpha', 'pal-math', 'pal-colored-objects']
|
47 |
TOOLS_DEFAULT_LIST = ['serpapi', 'pal-math']
|
48 |
BUG_FOUND_MSG = "Congratulations, you've found a bug in this application!"
|
49 |
# AUTH_ERR_MSG = "Please paste your OpenAI key from openai.com to use this application. It is not necessary to hit a button or key after pasting it."
|
@@ -409,6 +411,7 @@ class ChatWrapper:
|
|
409 |
history.append((inp, text_to_display))
|
410 |
|
411 |
html_video, temp_file, html_audio, temp_aud_file = None, None, None, None
|
|
|
412 |
if speak_text:
|
413 |
if talking_head:
|
414 |
if len(output) <= MAX_TALKING_HEAD_TEXT_LENGTH:
|
@@ -427,6 +430,7 @@ class ChatWrapper:
|
|
427 |
# html_audio, temp_aud_file = do_html_audio_speak(output, translate_to)
|
428 |
# html_video = create_html_video(temp_file, "128")
|
429 |
pass
|
|
|
430 |
|
431 |
except Exception as e:
|
432 |
raise e
|
@@ -441,9 +445,11 @@ chat = ChatWrapper()
|
|
441 |
|
442 |
def do_html_audio_speak(words_to_speak, polly_language):
|
443 |
polly_client = boto3.Session(
|
444 |
-
aws_access_key_id=os.environ["AWS_ACCESS_KEY_ID"],
|
445 |
-
|
446 |
-
|
|
|
|
|
447 |
).client('polly')
|
448 |
|
449 |
# voice_id, language_code, engine = POLLY_VOICE_DATA.get_voice(polly_language, "Female")
|
|
|
40 |
from langchain.docstore.document import Document
|
41 |
from langchain.chains.question_answering import load_qa_chain
|
42 |
|
43 |
+
#news_api_key = os.environ["NEWS_API_KEY"]
|
44 |
+
news_api_key = 'placeholder'
|
45 |
+
#tmdb_bearer_token = os.environ["TMDB_BEARER_TOKEN"]
|
46 |
+
tmdb_bearer_token = 'placeholder'
|
47 |
|
48 |
+
TOOLS_LIST = ['serpapi', 'wolfram-alpha', 'pal-math', 'pal-colored-objects']
|
49 |
TOOLS_DEFAULT_LIST = ['serpapi', 'pal-math']
|
50 |
BUG_FOUND_MSG = "Congratulations, you've found a bug in this application!"
|
51 |
# AUTH_ERR_MSG = "Please paste your OpenAI key from openai.com to use this application. It is not necessary to hit a button or key after pasting it."
|
|
|
411 |
history.append((inp, text_to_display))
|
412 |
|
413 |
html_video, temp_file, html_audio, temp_aud_file = None, None, None, None
|
414 |
+
"""
|
415 |
if speak_text:
|
416 |
if talking_head:
|
417 |
if len(output) <= MAX_TALKING_HEAD_TEXT_LENGTH:
|
|
|
430 |
# html_audio, temp_aud_file = do_html_audio_speak(output, translate_to)
|
431 |
# html_video = create_html_video(temp_file, "128")
|
432 |
pass
|
433 |
+
"""
|
434 |
|
435 |
except Exception as e:
|
436 |
raise e
|
|
|
445 |
|
446 |
def do_html_audio_speak(words_to_speak, polly_language):
|
447 |
polly_client = boto3.Session(
|
448 |
+
# aws_access_key_id=os.environ["AWS_ACCESS_KEY_ID"],
|
449 |
+
aws_acess_key='AKIA4T67MT6GEZL5DSEZ',
|
450 |
+
# aws_secret_access_key=os.environ["AWS_SECRET_ACCESS_KEY"],
|
451 |
+
aws_secret_access_key='mh5pzewb6mzEhDrBV+SmABqVw7s0y8CtkKvWXHn8',
|
452 |
+
region_name='eu-west-2'
|
453 |
).client('polly')
|
454 |
|
455 |
# voice_id, language_code, engine = POLLY_VOICE_DATA.get_voice(polly_language, "Female")
|