diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d9a5e7b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# please visit https://github.com/xfyun/aiges/releases to get stable and suitable iamges. + +FROM docker.io/library/python:3.8.9 + +RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list +RUN sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list + +RUN --mount=target=/root/packages.txt,source=packages.txt apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/* + + +WORKDIR /home/user/app +RUN useradd -m -u 1000 user +RUN chown -R 1000.1000 /home/user + +RUN mkdir /home/user/app/hub/ +RUN mkdir /home/user/app/hub/checkpoints + + +RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/ + +RUN pip install --no-cache-dir openai==0.27.2 +RUN pip install --no-cache-dir gradio==3.21.0 +RUN pip install --no-cache-dir pip==22.3.1 +RUN --mount=target=requirements.txt,source=requirements.txt pip install --no-cache-dir -r requirements.txt + + +COPY --chown=1000 ./ /home/user/app + +COPY --chown=1000 hub/checkpoints /root/.cache/torch/hub/checkpoints + +CMD ["python3", "app.py"] \ No newline at end of file diff --git a/__pycache__/azure_utils.cpython-39.pyc b/__pycache__/azure_utils.cpython-39.pyc new file mode 100644 index 0000000..ea81189 Binary files /dev/null and b/__pycache__/azure_utils.cpython-39.pyc differ diff --git a/__pycache__/polly_utils.cpython-39.pyc b/__pycache__/polly_utils.cpython-39.pyc new file mode 100644 index 0000000..bbb0bdc Binary files /dev/null and b/__pycache__/polly_utils.cpython-39.pyc differ diff --git a/app.py b/app.py index 046e2c4..06f95c8 100644 --- a/app.py +++ b/app.py @@ -40,8 +40,11 @@ from langchain.vectorstores.faiss import FAISS from langchain.docstore.document import Document from langchain.chains.question_answering import load_qa_chain -news_api_key = os.environ["NEWS_API_KEY"] -tmdb_bearer_token = os.environ["TMDB_BEARER_TOKEN"] +news_api_key = "0" +tmdb_bearer_token = "0" + +# news_api_key = os.environ["NEWS_API_KEY"] +# tmdb_bearer_token = os.environ["TMDB_BEARER_TOKEN"] TOOLS_LIST = ['serpapi', 'wolfram-alpha', 'pal-math', 'pal-colored-objects'] # 'google-search','news-api','tmdb-api','open-meteo-api' @@ -724,7 +727,7 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block: with gr.Tab("Whisper STT"): whisper_lang_radio = gr.Radio(label="Whisper speech-to-text language:", choices=[ - WHISPER_DETECT_LANG, "Arabic", "Arabic (Gulf)", "Catalan", "Chinese (Cantonese)", "Chinese (Mandarin)", + "Chinese (Mandarin)", WHISPER_DETECT_LANG, "Arabic", "Arabic (Gulf)", "Catalan", "Danish", "Dutch", "English (Australian)", "English (British)", "English (Indian)", "English (New Zealand)", "English (South African)", "English (US)", "English (Welsh)", "Finnish", "French", "French (Canadian)", "German", "German (Austrian)", "Georgian", "Hindi", "Icelandic", "Indonesian", "Italian", "Japanese", @@ -746,7 +749,7 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as block: outputs=[lang_level_state]) translate_to_radio = gr.Radio(label="Language:", choices=[ - TRANSLATE_TO_DEFAULT, "Arabic", "Arabic (Gulf)", "Catalan", "Chinese (Cantonese)", "Chinese (Mandarin)", + "Chinese (Cantonese)", TRANSLATE_TO_DEFAULT, "Arabic", "Arabic (Gulf)", "Catalan", "Chinese (Mandarin)", "Danish", "Dutch", "English (Australian)", "English (British)", "English (Indian)", "English (New Zealand)", "English (South African)", "English (US)", "English (Welsh)", "Finnish", "French", "French (Canadian)", "German", "German (Austrian)", "Georgian", "Hindi", "Icelandic", "Indonesian", "Italian", "Japanese", diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c5647ff --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +google-search-results==2.4.2 +google-api-python-client==2.81.0 +wolframalpha +langchain==0.0.113 +requests==2.28.2 +git+https://github.com/openai/whisper.git +boto3==1.26.93 +faiss-cpu \ No newline at end of file