Skip to content

Commit

Permalink
Merge pull request #107 from fractalego/new-version
Browse files Browse the repository at this point in the history
fixed bug on run_from_audio
  • Loading branch information
fractalego committed Jul 20, 2024
2 parents cbdd0d1 + 906146d commit 3408ecd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
9 changes: 6 additions & 3 deletions wafl/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
download_models,
)
from wafl.runners.run_from_actions import run_action
from wafl.runners.run_from_audio import run_from_audio
from wafl.runners.run_web_and_audio_interface import run_app
from wafl.runners.run_web_interface import run_server_only_app


def print_help():
Expand Down Expand Up @@ -53,6 +50,8 @@ def process_cli():
download_models()

elif command == "run":
from wafl.runners.run_web_and_audio_interface import run_app

run_app()
remove_preprocessed("/")

Expand All @@ -61,10 +60,14 @@ def process_cli():
remove_preprocessed("/")

elif command == "run-audio":
from wafl.runners.run_from_audio import run_from_audio

run_from_audio()
remove_preprocessed("/")

elif command == "run-server":
from wafl.runners.run_web_interface import run_server_only_app

run_server_only_app()
remove_preprocessed("/")

Expand Down
1 change: 0 additions & 1 deletion wafl/interface/voice_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def __init__(self, config):
config.get_value("listener_model")["listener_hotword_logp"]
)
self._bot_has_spoken = False
self._utterances = []

def add_hotwords(self, hotwords):
self._listener.add_hotwords(hotwords)
Expand Down
4 changes: 1 addition & 3 deletions wafl/runners/run_from_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def run_from_audio():
interface,
conversation_events,
_logger,
activation_word="",
max_misses=-1,
deactivate_on_closed_conversation=False,
activation_word=config.get_value("waking_up_word"),
)
scheduler = Scheduler([conversation_loop])
scheduler.run()
Expand Down
4 changes: 1 addition & 3 deletions wafl/runners/run_web_and_audio_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ def create_web_and_audio_scheduler_and_webserver_loop(conversation_id):
_logger,
activation_word=config.get_value("waking_up_word"),
)
web_handler = WebHandler(
interface, config, conversation_id, conversation_events
)
web_handler = WebHandler(interface, config, conversation_id, conversation_events)
return {
"scheduler": Scheduler([conversation_loop, web_handler]),
"web_server_handler": web_handler,
Expand Down
4 changes: 1 addition & 3 deletions wafl/runners/run_web_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ def create_scheduler_and_webserver_loop(conversation_id):
deactivate_on_closed_conversation=False,
)
asyncio.run(interface.output("Hello. How may I help you?"))
web_handler = WebHandler(
interface, config, conversation_id, conversation_events
)
web_handler = WebHandler(interface, config, conversation_id, conversation_events)
return {
"scheduler": Scheduler([conversation_loop, web_handler]),
"web_server_handler": web_handler,
Expand Down
6 changes: 4 additions & 2 deletions wafl/templates/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

if __name__ == "__main__":
print(get_variables())
app.run(host="0.0.0.0", port=Configuration.load_local_config().get_value("frontend_port"))

app.run(
host="0.0.0.0",
port=Configuration.load_local_config().get_value("frontend_port"),
)

0 comments on commit 3408ecd

Please sign in to comment.