You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dataset.py 955B

123456789101112131415161718192021222324252627282930313233
  1. from .base import Base
  2. class DataSet(Base):
  3. class ParseConfig(Base):
  4. def __init__(self, rag, res_dict):
  5. self.chunk_token_count = 128
  6. self.layout_recognize = True
  7. self.delimiter = '\n!?。;!?'
  8. self.task_page_size = 12
  9. super().__init__(rag, res_dict)
  10. def __init__(self, rag, res_dict):
  11. self.id = ""
  12. self.name = ""
  13. self.avatar = ""
  14. self.tenant_id = None
  15. self.description = ""
  16. self.language = "English"
  17. self.embedding_model = ""
  18. self.permission = "me"
  19. self.document_count = 0
  20. self.chunk_count = 0
  21. self.parse_method = 0
  22. self.parser_config = None
  23. super().__init__(rag, res_dict)
  24. def delete(self):
  25. try:
  26. self.post("/rm", {"kb_id": self.id})
  27. return True
  28. except Exception:
  29. return False