Teapack1 commited on
Commit
7d5dbff
1 Parent(s): 42a2848

without gradio

Browse files
__pycache__/server.cpython-310.pyc CHANGED
Binary files a/__pycache__/server.cpython-310.pyc and b/__pycache__/server.cpython-310.pyc differ
 
app.py CHANGED
@@ -1,11 +1,6 @@
1
- import json
2
- import os
3
- import requests
4
- import socket
5
  import subprocess
6
 
7
- subprocess.run("uvicorn server:app", shell=True)
8
-
9
 
10
  #os.system("uvicorn server:app --reload")
11
 
@@ -13,7 +8,6 @@ subprocess.run("uvicorn server:app", shell=True)
13
  def start_server():
14
  os.system("uvicorn server:app --port 8080 --workers 2")
15
 
16
-
17
  def is_port_in_use(port):
18
  with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
19
  return s.connect_ex(('0.0.0.0', port)) == 0
@@ -25,4 +19,4 @@ def main():
25
  start_server()
26
 
27
  main()
28
- """
 
 
 
 
 
1
  import subprocess
2
 
3
+ subprocess.run(["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "2"])
 
4
 
5
  #os.system("uvicorn server:app --reload")
6
 
 
8
  def start_server():
9
  os.system("uvicorn server:app --port 8080 --workers 2")
10
 
 
11
  def is_port_in_use(port):
12
  with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
13
  return s.connect_ex(('0.0.0.0', port)) == 0
 
19
  start_server()
20
 
21
  main()
22
+ """
server.py CHANGED
@@ -64,6 +64,7 @@ async def listen(websocket, chunk_length_s=2.0, stream_chunk_s=2.0):
64
  audio_buffer.append(audio_chunk["raw"])
65
 
66
  prediction = intent_class_pipe(audio_chunk["raw"])
 
67
  await websocket.send_text(f"chunk: {prediction[0]['label']} | {i+1} / 4")
68
 
69
  if await is_silence(audio_chunk["raw"], threshold=0.7):
 
64
  audio_buffer.append(audio_chunk["raw"])
65
 
66
  prediction = intent_class_pipe(audio_chunk["raw"])
67
+ print(prediction)
68
  await websocket.send_text(f"chunk: {prediction[0]['label']} | {i+1} / 4")
69
 
70
  if await is_silence(audio_chunk["raw"], threshold=0.7):
templates/index.html CHANGED
@@ -49,7 +49,7 @@
49
  </section>
50
  </main>
51
  </div>
52
- <script src="/static/script.js?v=8"></script>
53
 
54
  </body>
55
  </html>
 
49
  </section>
50
  </main>
51
  </div>
52
+ <script src="/static/script.js?v=9"></script>
53
 
54
  </body>
55
  </html>
transformers ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 8ef0e0916534110f93fb4734ae91480ee0a9d4ca