Spaces:
Runtime error
Runtime error
MSchell0129
commited on
Commit
·
c508458
1
Parent(s):
a76862a
update
Browse files- README.md +2 -0
- general_chatbot.py +7 -0
- requirements.txt +214 -0
- speech_to_text.py +3 -1
- test.Dockerfile +6 -1
- text_to_speech.py +1 -0
README.md
CHANGED
@@ -4,6 +4,8 @@ emoji: 👀
|
|
4 |
colorFrom: gray
|
5 |
colorTo: blue
|
6 |
sdk: docker
|
|
|
|
|
7 |
pinned: false
|
8 |
---
|
9 |
|
|
|
4 |
colorFrom: gray
|
5 |
colorTo: blue
|
6 |
sdk: docker
|
7 |
+
app_port: 7860
|
8 |
+
app_file: speech_to_text.py
|
9 |
pinned: false
|
10 |
---
|
11 |
|
general_chatbot.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#Look at integrating with the following:
|
2 |
+
# Chatbots
|
3 |
+
#Agents
|
4 |
+
# Interacting with APIs
|
5 |
+
# Code Understanding
|
6 |
+
|
7 |
+
#import depencdencies
|
requirements.txt
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file may be used to create an environment using:
|
2 |
+
# $ conda create --name <env> --file <this file>
|
3 |
+
# platform: win-64
|
4 |
+
aiofiles=23.2.1=pypi_0
|
5 |
+
aiohttp=3.8.5=pypi_0
|
6 |
+
aiosignal=1.3.1=pypi_0
|
7 |
+
altair=5.0.1=pypi_0
|
8 |
+
anyio=3.7.1=pypi_0
|
9 |
+
asttokens=2.2.1=pyhd8ed1ab_0
|
10 |
+
async-timeout=4.0.2=pypi_0
|
11 |
+
attrs=23.1.0=pypi_0
|
12 |
+
authlib=1.2.1=pypi_0
|
13 |
+
backcall=0.2.0=pyh9f0ad1d_0
|
14 |
+
backports=1.0=pyhd8ed1ab_3
|
15 |
+
backports.functools_lru_cache=1.6.5=pyhd8ed1ab_0
|
16 |
+
beautifulsoup4=4.12.2=pypi_0
|
17 |
+
blas=1.0=mkl
|
18 |
+
blis=0.7.10=pypi_0
|
19 |
+
bottleneck=1.3.5=py310h9128911_0
|
20 |
+
bzip2=1.0.8=he774522_0
|
21 |
+
ca-certificates=2023.7.22=h56e8100_0
|
22 |
+
cachetools=5.3.1=pypi_0
|
23 |
+
catalogue=2.0.9=pypi_0
|
24 |
+
certifi=2023.7.22=pypi_0
|
25 |
+
cffi=1.15.1=pypi_0
|
26 |
+
charset-normalizer=3.2.0=pypi_0
|
27 |
+
click=8.1.6=pypi_0
|
28 |
+
colorama=0.4.6=pyhd8ed1ab_0
|
29 |
+
comm=0.1.4=pyhd8ed1ab_0
|
30 |
+
confection=0.1.1=pypi_0
|
31 |
+
contourpy=1.1.0=pypi_0
|
32 |
+
cryptography=41.0.3=pypi_0
|
33 |
+
cycler=0.11.0=pypi_0
|
34 |
+
cymem=2.0.7=pypi_0
|
35 |
+
dataclasses-json=0.5.14=pypi_0
|
36 |
+
debugpy=1.6.7=py310hd77b12b_0
|
37 |
+
decorator=5.1.1=pyhd8ed1ab_0
|
38 |
+
dill=0.3.7=pypi_0
|
39 |
+
dnspython=2.4.1=pypi_0
|
40 |
+
docx=0.2.4=pypi_0
|
41 |
+
elastic-transport=8.4.0=pypi_0
|
42 |
+
elasticsearch=8.9.0=pypi_0
|
43 |
+
exceptiongroup=1.1.2=pypi_0
|
44 |
+
executing=1.2.0=pyhd8ed1ab_0
|
45 |
+
faiss-cpu=1.7.4=pypi_0
|
46 |
+
fastapi=0.101.1=pypi_0
|
47 |
+
ffmpeg-python=0.2.0=pypi_0
|
48 |
+
ffmpy=0.3.1=pypi_0
|
49 |
+
filelock=3.12.2=pypi_0
|
50 |
+
findspark=2.0.1=pypi_0
|
51 |
+
fonttools=4.42.1=pypi_0
|
52 |
+
frozenlist=1.4.0=pypi_0
|
53 |
+
fsspec=2023.6.0=pypi_0
|
54 |
+
future=0.18.3=pypi_0
|
55 |
+
google-api-core=2.11.1=pypi_0
|
56 |
+
google-api-python-client=2.70.0=pypi_0
|
57 |
+
google-auth=2.22.0=pypi_0
|
58 |
+
google-auth-httplib2=0.1.0=pypi_0
|
59 |
+
googleapis-common-protos=1.60.0=pypi_0
|
60 |
+
gradio=3.40.1=pypi_0
|
61 |
+
gradio-client=0.4.0=pypi_0
|
62 |
+
greenlet=2.0.2=pypi_0
|
63 |
+
grpcio=1.56.2=pypi_0
|
64 |
+
grpcio-tools=1.56.2=pypi_0
|
65 |
+
h11=0.14.0=pypi_0
|
66 |
+
h2=4.1.0=pypi_0
|
67 |
+
hpack=4.0.0=pypi_0
|
68 |
+
httpcore=0.17.3=pypi_0
|
69 |
+
httplib2=0.22.0=pypi_0
|
70 |
+
httpx=0.24.1=pypi_0
|
71 |
+
huggingface-hub=0.16.4=pypi_0
|
72 |
+
hyperframe=6.0.1=pypi_0
|
73 |
+
idna=3.4=pypi_0
|
74 |
+
importlib-metadata=6.8.0=pyha770c72_0
|
75 |
+
importlib-resources=6.0.1=pypi_0
|
76 |
+
importlib_metadata=6.8.0=hd8ed1ab_0
|
77 |
+
intel-openmp=2023.1.0=h59b6b97_46319
|
78 |
+
ipykernel=6.25.1=pyh6817e22_0
|
79 |
+
ipython=8.14.0=pyh08f2357_0
|
80 |
+
jaraco-context=4.3.0=pypi_0
|
81 |
+
jedi=0.19.0=pyhd8ed1ab_0
|
82 |
+
jinja2=3.1.2=pypi_0
|
83 |
+
joblib=1.3.1=pypi_0
|
84 |
+
jsonschema=4.19.0=pypi_0
|
85 |
+
jsonschema-specifications=2023.7.1=pypi_0
|
86 |
+
jupyter_client=8.3.0=pyhd8ed1ab_0
|
87 |
+
jupyter_core=5.3.1=py310h5588dad_0
|
88 |
+
kiwisolver=1.4.4=pypi_0
|
89 |
+
langchain=0.0.74=pypi_0
|
90 |
+
langcodes=3.3.0=pypi_0
|
91 |
+
libffi=3.4.4=hd77b12b_0
|
92 |
+
libsodium=1.0.18=h8d14728_1
|
93 |
+
linkify-it-py=2.0.2=pypi_0
|
94 |
+
llvmlite=0.40.1=pypi_0
|
95 |
+
loguru=0.7.0=pypi_0
|
96 |
+
lxml=4.9.3=pypi_0
|
97 |
+
manifest-ml=0.0.1=pypi_0
|
98 |
+
markdown-it-py=2.2.0=pypi_0
|
99 |
+
markupsafe=2.1.3=pypi_0
|
100 |
+
marshmallow=3.20.1=pypi_0
|
101 |
+
matplotlib=3.7.2=pypi_0
|
102 |
+
matplotlib-inline=0.1.6=pyhd8ed1ab_0
|
103 |
+
matplotlip=0.2=pypi_0
|
104 |
+
mdit-py-plugins=0.3.3=pypi_0
|
105 |
+
mdurl=0.1.2=pypi_0
|
106 |
+
mkl=2023.1.0=h8bd8f75_46356
|
107 |
+
mkl-service=2.4.0=py310h2bbff1b_1
|
108 |
+
mkl_fft=1.3.6=py310h4ed8f06_1
|
109 |
+
mkl_random=1.2.2=py310h4ed8f06_1
|
110 |
+
more-itertools=10.1.0=pypi_0
|
111 |
+
multidict=6.0.4=pypi_0
|
112 |
+
murmurhash=1.0.9=pypi_0
|
113 |
+
mypy-extensions=1.0.0=pypi_0
|
114 |
+
nest-asyncio=1.5.6=pyhd8ed1ab_0
|
115 |
+
nltk=3.8.1=pypi_0
|
116 |
+
numba=0.57.1=pypi_0
|
117 |
+
numexpr=2.8.4=py310h2cd9be0_1
|
118 |
+
numpy=1.24.4=pypi_0
|
119 |
+
openai=0.27.8=pypi_0
|
120 |
+
openai-whisper=20230314=pypi_0
|
121 |
+
openssl=1.1.1l=h8ffe710_0
|
122 |
+
orjson=3.9.5=pypi_0
|
123 |
+
packaging=23.1=pyhd8ed1ab_0
|
124 |
+
pandas=1.5.3=py310h4ed8f06_0
|
125 |
+
parso=0.8.3=pyhd8ed1ab_0
|
126 |
+
pathy=0.10.2=pypi_0
|
127 |
+
pickleshare=0.7.5=py_1003
|
128 |
+
pillow=10.0.0=pypi_0
|
129 |
+
pinecone-client=2.2.2=pypi_0
|
130 |
+
pip=23.2.1=py310haa95532_0
|
131 |
+
platformdirs=3.10.0=pyhd8ed1ab_0
|
132 |
+
preshed=3.0.8=pypi_0
|
133 |
+
prompt-toolkit=3.0.39=pyha770c72_0
|
134 |
+
prompt_toolkit=3.0.39=hd8ed1ab_0
|
135 |
+
protobuf=4.23.4=pypi_0
|
136 |
+
psutil=5.9.0=py310h2bbff1b_0
|
137 |
+
pure_eval=0.2.2=pyhd8ed1ab_0
|
138 |
+
py4j=0.10.9.7=pypi_0
|
139 |
+
pyasn1=0.5.0=pypi_0
|
140 |
+
pyasn1-modules=0.3.0=pypi_0
|
141 |
+
pycparser=2.21=pypi_0
|
142 |
+
pydantic=1.10.12=pypi_0
|
143 |
+
pydub=0.25.1=pypi_0
|
144 |
+
pygments=2.16.1=pyhd8ed1ab_0
|
145 |
+
pyparsing=3.0.9=pypi_0
|
146 |
+
pyspark=3.4.1=pypi_0
|
147 |
+
python=3.10.0=h96c0403_3
|
148 |
+
python-dateutil=2.8.2=pyhd3eb1b0_0
|
149 |
+
python-multipart=0.0.6=pypi_0
|
150 |
+
python_abi=3.10=2_cp310
|
151 |
+
pytz=2022.7=py310haa95532_0
|
152 |
+
pywin32=305=py310h2bbff1b_0
|
153 |
+
pyyaml=6.0.1=pypi_0
|
154 |
+
pyzmq=23.2.1=py310h73ada01_0
|
155 |
+
qdrant-client=0.11.10=pypi_0
|
156 |
+
redis=4.6.0=pypi_0
|
157 |
+
referencing=0.30.2=pypi_0
|
158 |
+
regex=2023.6.3=pypi_0
|
159 |
+
requests=2.31.0=pypi_0
|
160 |
+
rpds-py=0.9.2=pypi_0
|
161 |
+
rsa=4.9=pypi_0
|
162 |
+
safetensors=0.3.1=pypi_0
|
163 |
+
semantic-version=2.10.0=pypi_0
|
164 |
+
setuptools=68.0.0=py310haa95532_0
|
165 |
+
six=1.16.0=pyhd3eb1b0_1
|
166 |
+
smart-open=6.3.0=pypi_0
|
167 |
+
sniffio=1.3.0=pypi_0
|
168 |
+
soupsieve=2.4.1=pypi_0
|
169 |
+
spacy=3.6.0=pypi_0
|
170 |
+
spacy-legacy=3.0.12=pypi_0
|
171 |
+
spacy-loggers=1.0.4=pypi_0
|
172 |
+
sqlalchemy=1.4.49=pypi_0
|
173 |
+
sqlite=3.41.2=h2bbff1b_0
|
174 |
+
sqlitedict=2.1.0=pypi_0
|
175 |
+
srsly=2.4.7=pypi_0
|
176 |
+
stack_data=0.6.2=pyhd8ed1ab_0
|
177 |
+
starlette=0.27.0=pypi_0
|
178 |
+
tbb=2021.8.0=h59b6b97_0
|
179 |
+
thinc=8.1.11=pypi_0
|
180 |
+
tiktoken=0.3.1=pypi_0
|
181 |
+
tk=8.6.12=h2bbff1b_0
|
182 |
+
tokenizers=0.13.3=pypi_0
|
183 |
+
toolz=0.12.0=pypi_0
|
184 |
+
torch=1.13.1=pypi_0
|
185 |
+
tornado=6.2=py310he2412df_0
|
186 |
+
tqdm=4.65.0=pypi_0
|
187 |
+
traitlets=5.9.0=pyhd8ed1ab_0
|
188 |
+
transformers=4.31.0=pypi_0
|
189 |
+
typer=0.9.0=pypi_0
|
190 |
+
typing-extensions=4.7.1=hd8ed1ab_0
|
191 |
+
typing-inspect=0.9.0=pypi_0
|
192 |
+
typing_extensions=4.7.1=pyha770c72_0
|
193 |
+
tzdata=2023c=h04d1e81_0
|
194 |
+
uc-micro-py=1.0.2=pypi_0
|
195 |
+
uritemplate=4.1.1=pypi_0
|
196 |
+
urllib3=1.26.16=pypi_0
|
197 |
+
uvicorn=0.23.2=pypi_0
|
198 |
+
validators=0.20.0=pypi_0
|
199 |
+
vc=14.2=h21ff451_1
|
200 |
+
vs2015_runtime=14.27.29016=h5e58377_2
|
201 |
+
wasabi=1.1.2=pypi_0
|
202 |
+
wcwidth=0.2.6=pyhd8ed1ab_0
|
203 |
+
weaviate-client=3.22.1=pypi_0
|
204 |
+
websockets=11.0.3=pypi_0
|
205 |
+
wheel=0.38.4=py310haa95532_0
|
206 |
+
wikipedia=1.4.0=pypi_0
|
207 |
+
win32-setctime=1.1.0=pypi_0
|
208 |
+
wolframalpha=5.0.0=pypi_0
|
209 |
+
xmltodict=0.13.0=pypi_0
|
210 |
+
xz=5.4.2=h8cc25b3_0
|
211 |
+
yarl=1.9.2=pypi_0
|
212 |
+
zeromq=4.3.4=h0e60522_1
|
213 |
+
zipp=3.16.2=pyhd8ed1ab_0
|
214 |
+
zlib=1.2.13=h8cc25b3_0
|
speech_to_text.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import openai
|
2 |
import whisper
|
3 |
-
|
4 |
from api_key import open_ai_key
|
5 |
|
6 |
llm = openai(temperature=0, openai_api_key='open_ai_key')
|
@@ -9,6 +9,7 @@ llm = openai(temperature=0, openai_api_key='open_ai_key')
|
|
9 |
|
10 |
#This is another alternative, but this block allows for the detection of the language and it also provides lowever-level access to the model
|
11 |
|
|
|
12 |
def transcribe(aud_inp, whisper_lang):
|
13 |
if aud_inp is None:
|
14 |
return ''
|
@@ -26,5 +27,6 @@ def transcribe(aud_inp, whisper_lang):
|
|
26 |
result = whisper.decode(model, mel, options)
|
27 |
print(result.text)
|
28 |
return result
|
|
|
29 |
if __name__ == '__main__':
|
30 |
transcribe('audio_file_path', 'whisper-1')
|
|
|
1 |
import openai
|
2 |
import whisper
|
3 |
+
import gradio as gr
|
4 |
from api_key import open_ai_key
|
5 |
|
6 |
llm = openai(temperature=0, openai_api_key='open_ai_key')
|
|
|
9 |
|
10 |
#This is another alternative, but this block allows for the detection of the language and it also provides lowever-level access to the model
|
11 |
|
12 |
+
|
13 |
def transcribe(aud_inp, whisper_lang):
|
14 |
if aud_inp is None:
|
15 |
return ''
|
|
|
27 |
result = whisper.decode(model, mel, options)
|
28 |
print(result.text)
|
29 |
return result
|
30 |
+
|
31 |
if __name__ == '__main__':
|
32 |
transcribe('audio_file_path', 'whisper-1')
|
test.Dockerfile
CHANGED
@@ -1 +1,6 @@
|
|
1 |
-
FROM
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10
|
2 |
+
WORKDIR /content
|
3 |
+
COPY ./requirements.txt /content/requirements.txt
|
4 |
+
RUN pip install --no-cache-dir --upgrade -r /content/requirements.txt
|
5 |
+
COPY . .
|
6 |
+
CMD ["speech_to_text:app", "--host", "0.0.0.0", "--port", "7860"]
|
text_to_speech.py
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
#need to figure this out
|