Skip to content

Instantly share code, notes, and snippets.

View argosopentech's full-sized avatar
🚀

Argos Open Tech argosopentech

🚀
View GitHub Profile
@argosopentech
argosopentech / memory_leak.py
Created October 29, 2020 02:10
Memory Leak in Python with PyQt and OpenNMT CTranslate
from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5.QtCore import QThread
import ctranslate2
class WorkerThread(QThread):
def __del__(self):
self.wait()
def run(self):
translator = ctranslate2.Translator('/path/to/ctranslate/model')