mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-01 07:22:01 +08:00
remove file size check for sdk API (#3066)
### What problem does this PR solve? ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [ ] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [x] Refactoring - [ ] Performance Improvement - [ ] Other (please describe):
This commit is contained in:
parent
e56bd770ea
commit
d133cc043b
@ -46,14 +46,6 @@ from rag.utils.es_conn import ELASTICSEARCH
|
|||||||
from rag.utils.storage_factory import STORAGE_IMPL
|
from rag.utils.storage_factory import STORAGE_IMPL
|
||||||
import os
|
import os
|
||||||
|
|
||||||
MAXIMUM_OF_UPLOADING_FILES = 256
|
|
||||||
|
|
||||||
MAXIMUM_OF_UPLOADING_FILES = 256
|
|
||||||
|
|
||||||
MAXIMUM_OF_UPLOADING_FILES = 256
|
|
||||||
|
|
||||||
MAXIMUM_OF_UPLOADING_FILES = 256
|
|
||||||
|
|
||||||
|
|
||||||
@manager.route('/datasets/<dataset_id>/documents', methods=['POST'])
|
@manager.route('/datasets/<dataset_id>/documents', methods=['POST'])
|
||||||
@token_required
|
@token_required
|
||||||
@ -66,17 +58,7 @@ def upload(dataset_id, tenant_id):
|
|||||||
if file_obj.filename == '':
|
if file_obj.filename == '':
|
||||||
return get_result(
|
return get_result(
|
||||||
retmsg='No file selected!', retcode=RetCode.ARGUMENT_ERROR)
|
retmsg='No file selected!', retcode=RetCode.ARGUMENT_ERROR)
|
||||||
# total size
|
|
||||||
total_size = 0
|
|
||||||
for file_obj in file_objs:
|
|
||||||
file_obj.seek(0, os.SEEK_END)
|
|
||||||
total_size += file_obj.tell()
|
|
||||||
file_obj.seek(0)
|
|
||||||
MAX_TOTAL_FILE_SIZE=10*1024*1024
|
|
||||||
if total_size > MAX_TOTAL_FILE_SIZE:
|
|
||||||
return get_result(
|
|
||||||
retmsg=f'Total file size exceeds 10MB limit! ({total_size / (1024 * 1024):.2f} MB)',
|
|
||||||
retcode=RetCode.ARGUMENT_ERROR)
|
|
||||||
e, kb = KnowledgebaseService.get_by_id(dataset_id)
|
e, kb = KnowledgebaseService.get_by_id(dataset_id)
|
||||||
if not e:
|
if not e:
|
||||||
raise LookupError(f"Can't find the dataset with ID {dataset_id}!")
|
raise LookupError(f"Can't find the dataset with ID {dataset_id}!")
|
||||||
|
@ -52,6 +52,6 @@ This file must be configured to point to your RAGFlow instance, with the `ragflo
|
|||||||
Before you can use this plugin, ensure the following are in place:
|
Before you can use this plugin, ensure the following are in place:
|
||||||
|
|
||||||
1. You have installed and configured [ChatGPT-on-WeChat](https://github.com/zhayujie/chatgpt-on-wechat).
|
1. You have installed and configured [ChatGPT-on-WeChat](https://github.com/zhayujie/chatgpt-on-wechat).
|
||||||
2. You have deployed and are running the [RAGFlow](https://github.com/jina-ai/ragflow) server.
|
2. You have deployed and are running the [RAGFlow](https://github.com/infiniflow/ragflow) server.
|
||||||
|
|
||||||
Make sure both `config.json` files (ChatGPT-on-WeChat and RAGFlow Chat Plugin) are correctly set up as per the examples above.
|
Make sure both `config.json` files (ChatGPT-on-WeChat and RAGFlow Chat Plugin) are correctly set up as per the examples above.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user