mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 02:29:03 +08:00
Fix preview issue in file manager. (#3846)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
fc38afcec4
commit
3f3469130b
@ -329,8 +329,13 @@ def get(file_id):
|
|||||||
e, file = FileService.get_by_id(file_id)
|
e, file = FileService.get_by_id(file_id)
|
||||||
if not e:
|
if not e:
|
||||||
return get_data_error_result(message="Document not found!")
|
return get_data_error_result(message="Document not found!")
|
||||||
b, n = File2DocumentService.get_storage_address(file_id=file_id)
|
|
||||||
response = flask.make_response(STORAGE_IMPL.get(b, n))
|
blob = STORAGE_IMPL.get(file.parent_id, file.location)
|
||||||
|
if not blob:
|
||||||
|
b, n = File2DocumentService.get_storage_address(file_id=file_id)
|
||||||
|
blob = STORAGE_IMPL.get(b, n)
|
||||||
|
|
||||||
|
response = flask.make_response(blob)
|
||||||
ext = re.search(r"\.([^.]+)$", file.name)
|
ext = re.search(r"\.([^.]+)$", file.name)
|
||||||
if ext:
|
if ext:
|
||||||
if file.type == FileType.VISUAL.value:
|
if file.type == FileType.VISUAL.value:
|
||||||
|
@ -126,7 +126,6 @@ class YoudaoRerank(DefaultRerank):
|
|||||||
with YoudaoRerank._model_lock:
|
with YoudaoRerank._model_lock:
|
||||||
if not YoudaoRerank._model:
|
if not YoudaoRerank._model:
|
||||||
try:
|
try:
|
||||||
logging.info("LOADING BCE...")
|
|
||||||
YoudaoRerank._model = RerankerModel(model_name_or_path=os.path.join(
|
YoudaoRerank._model = RerankerModel(model_name_or_path=os.path.join(
|
||||||
get_home_cache_dir(),
|
get_home_cache_dir(),
|
||||||
re.sub(r"^[a-zA-Z0-9]+/", "", model_name)))
|
re.sub(r"^[a-zA-Z0-9]+/", "", model_name)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user