Merge pull request #202 from quymdh/dev-q

Update: agent.py, train.py
This commit is contained in:
Rai
2024-08-31 04:37:15 +10:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@ -390,7 +390,7 @@ class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer):
def start_event_polling(self):
# start a thread and pass in the mainloop
#_thread.start_new_thread(self._event_poller, (asyncio.get_event_loop(),))
threading.Thread(target=self._event_poller, args=(asyncio.get_event_loop(),), name="Event Polling", daemon=True)
threading.Thread(target=self._event_poller, args=(asyncio.get_event_loop(),), name="Event Polling", daemon=True).start()
def is_module_running(self, module):
s = self.session()

View File

@ -1,4 +1,4 @@
import _thread
# import _thread
import threading
import time
import random
@ -112,7 +112,7 @@ class AsyncTrainer(object):
def start_ai(self):
#_thread.start_new_thread(self._ai_worker, ())
threading.Thread(target=self._ai_worker, args=(), name="AI Worker" daemon=True).start()
threading.Thread(target=self._ai_worker, args=(), name="AI Worker", daemon=True).start()
def _save_ai(self):
logging.info("[AI] saving model to %s ..." % self._nn_path)