Fixed typo
QueueStack -> ProcessStack
This commit is contained in:
parent
70e6e6ca90
commit
3801925b72
10
src/app.py
10
src/app.py
@ -5,8 +5,8 @@ import sys
|
|||||||
|
|
||||||
import config
|
import config
|
||||||
|
|
||||||
from queue_stack import QueueStack
|
from process_stack import ProcessQueue
|
||||||
from queue_stack.strategies import RecognizeAndSendStrategy
|
from process_stack.strategies import RecognizeAndSendStrategy
|
||||||
|
|
||||||
from recognizer import Recognizer
|
from recognizer import Recognizer
|
||||||
from recognizer.strategies import WhisperStrategy, FastWhisperStrategy
|
from recognizer.strategies import WhisperStrategy, FastWhisperStrategy
|
||||||
@ -22,8 +22,8 @@ fast_whisper_recognizer = Recognizer(FastWhisperStrategy())
|
|||||||
sos_message_service = MessageService(SosMessageStrategy())
|
sos_message_service = MessageService(SosMessageStrategy())
|
||||||
number_message_service = MessageService(NumberMessageStrategy())
|
number_message_service = MessageService(NumberMessageStrategy())
|
||||||
|
|
||||||
queue_stack = QueueStack(RecognizeAndSendStrategy())
|
process_stack = ProcessQueue(RecognizeAndSendStrategy())
|
||||||
queue_stack.start_loop_in_thread()
|
process_stack.start_loop_in_thread()
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def hello():
|
def hello():
|
||||||
@ -39,7 +39,7 @@ def recognize_files(message_service: MessageService):
|
|||||||
temp = NamedTemporaryFile()
|
temp = NamedTemporaryFile()
|
||||||
handle.save(temp)
|
handle.save(temp)
|
||||||
|
|
||||||
results.append(queue_stack.append_and_await((
|
results.append(process_stack.append_and_await((
|
||||||
temp,
|
temp,
|
||||||
whisper_recognizer,
|
whisper_recognizer,
|
||||||
message_service,
|
message_service,
|
||||||
|
@ -4,7 +4,7 @@ from dotenv import load_dotenv
|
|||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
HARPYIA_MODEL = os.getenv('HARPYIA_MODEL') or 'small'
|
HARPYIA_MODEL = os.getenv('HARPYIA_MODEL') or 'medium'
|
||||||
HARPYIA_LANGUAGE = os.getenv('HARPYIA_LANGUAGE') or 'ru'
|
HARPYIA_LANGUAGE = os.getenv('HARPYIA_LANGUAGE') or 'ru'
|
||||||
HARPYIA_SAMPLE_RATE = os.getenv('HARPYIA_SAMPLE_RATE') or 160000
|
HARPYIA_SAMPLE_RATE = os.getenv('HARPYIA_SAMPLE_RATE') or 160000
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ WHISPER_NUM_WORKERS = os.getenv('WHISPER_NUM_WORKERS') or 6
|
|||||||
WHISPER_CPU_THREADS = os.getenv('WHISPER_CPU_THREADS') or 10
|
WHISPER_CPU_THREADS = os.getenv('WHISPER_CPU_THREADS') or 10
|
||||||
WHISPER_BEAM_SIZE = os.getenv('WHISPER_BEAM_SIZE') or 5
|
WHISPER_BEAM_SIZE = os.getenv('WHISPER_BEAM_SIZE') or 5
|
||||||
|
|
||||||
SOS_PROMPT = os.getenv('SOS_PROMPT') or 'спасите помогите помощь пожар караул кирилл'
|
SOS_PROMPT = os.getenv('SOS_PROMPT') or 'спасите помогите помощь пожар караул гит'
|
||||||
NUMBER_PROMPT = os.getenv('NUMBER_PROMPT') or 'один два три четыре пять шесть семь восемь девять десять одинадцать двенадцать тринадцать сто сот'
|
NUMBER_PROMPT = os.getenv('NUMBER_PROMPT') or 'один два три четыре пять шесть семь восемь девять десять одинадцать двенадцать тринадцать сто сот'
|
||||||
|
|
||||||
RAT_URL = os.getenv('RAT_URL') or 'localhost:8081'
|
RAT_URL = os.getenv('RAT_URL') or 'localhost:8081'
|
||||||
|
1
src/process_stack/__init__.py
Normal file
1
src/process_stack/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from process_stack.process_stack import ProcessQueue
|
@ -2,9 +2,9 @@ import sys
|
|||||||
|
|
||||||
from threading import Thread, Event, Lock
|
from threading import Thread, Event, Lock
|
||||||
|
|
||||||
from queue_stack.strategies import BaseProcessStrategy
|
from process_stack.strategies import BaseProcessStrategy
|
||||||
|
|
||||||
class QueueStack:
|
class ProcessQueue:
|
||||||
def __init__(self, strategy: BaseProcessStrategy) -> None:
|
def __init__(self, strategy: BaseProcessStrategy) -> None:
|
||||||
self._stack = []
|
self._stack = []
|
||||||
self._strategy = strategy
|
self._strategy = strategy
|
2
src/process_stack/strategies/__init__.py
Normal file
2
src/process_stack/strategies/__init__.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
from process_stack.strategies.base_process_strategy import BaseProcessStrategy
|
||||||
|
from process_stack.strategies.recognize_and_send_strategy import RecognizeAndSendStrategy
|
@ -1,6 +1,6 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from queue_stack.strategies import BaseProcessStrategy
|
from process_stack.strategies import BaseProcessStrategy
|
||||||
from message import MessageService
|
from message import MessageService
|
||||||
from recognizer import Recognizer
|
from recognizer import Recognizer
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
from queue_stack.queue_stack import QueueStack
|
|
@ -1,2 +0,0 @@
|
|||||||
from queue_stack.strategies.base_process_strategy import BaseProcessStrategy
|
|
||||||
from queue_stack.strategies.recognize_and_send_strategy import RecognizeAndSendStrategy
|
|
Loading…
x
Reference in New Issue
Block a user