mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-07 02:55:08 +08:00
Compare commits
2 Commits
a23a0f230c
...
341a7b1473
| Author | SHA1 | Date | |
|---|---|---|---|
| 341a7b1473 | |||
| c29c395390 |
@ -351,7 +351,8 @@ class TextRecognizer:
|
|||||||
def close(self):
|
def close(self):
|
||||||
# close session and release manually
|
# close session and release manually
|
||||||
logging.info('Close TextRecognizer.')
|
logging.info('Close TextRecognizer.')
|
||||||
del self.predictor
|
if hasattr(self, "predictor"):
|
||||||
|
del self.predictor
|
||||||
gc.collect()
|
gc.collect()
|
||||||
|
|
||||||
def __call__(self, img_list):
|
def __call__(self, img_list):
|
||||||
@ -490,7 +491,8 @@ class TextDetector:
|
|||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
logging.info("Close TextDetector.")
|
logging.info("Close TextDetector.")
|
||||||
del self.predictor
|
if hasattr(self, "predictor"):
|
||||||
|
del self.predictor
|
||||||
gc.collect()
|
gc.collect()
|
||||||
|
|
||||||
def __call__(self, img):
|
def __call__(self, img):
|
||||||
|
|||||||
@ -408,7 +408,8 @@ class Recognizer:
|
|||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
logging.info("Close recognizer.")
|
logging.info("Close recognizer.")
|
||||||
del self.ort_sess
|
if hasattr(self, "ort_sess"):
|
||||||
|
del self.ort_sess
|
||||||
gc.collect()
|
gc.collect()
|
||||||
|
|
||||||
def __call__(self, image_list, thr=0.7, batch_size=16):
|
def __call__(self, image_list, thr=0.7, batch_size=16):
|
||||||
|
|||||||
@ -155,7 +155,12 @@ export const useComposeLlmOptionsByModelTypes = (
|
|||||||
options.forEach((x) => {
|
options.forEach((x) => {
|
||||||
const item = pre.find((y) => y.label === x.label);
|
const item = pre.find((y) => y.label === x.label);
|
||||||
if (item) {
|
if (item) {
|
||||||
item.options.push(...x.options);
|
x.options.forEach((y) => {
|
||||||
|
// A model that is both an image2text and speech2text model
|
||||||
|
if (!item.options.some((z) => z.value === y.value)) {
|
||||||
|
item.options.push(y);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
pre.push(x);
|
pre.push(x);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user