Skip to content

feat: 增加分段内容长短为100000个字符#477 #855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions apps/dataset/migrations/0007_alter_paragraph_content.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.14 on 2024-07-24 14:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('dataset', '0006_dataset_embedding_mode'),
]

operations = [
migrations.AlterField(
model_name='paragraph',
name='content',
field=models.CharField(max_length=102400, verbose_name='段落内容'),
),
]
2 changes: 1 addition & 1 deletion apps/dataset/models/data_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Paragraph(AppModelMixin):
id = models.UUIDField(primary_key=True, max_length=128, default=uuid.uuid1, editable=False, verbose_name="主键id")
document = models.ForeignKey(Document, on_delete=models.DO_NOTHING, db_constraint=False)
dataset = models.ForeignKey(DataSet, on_delete=models.DO_NOTHING)
content = models.CharField(max_length=4096, verbose_name="段落内容")
content = models.CharField(max_length=102400, verbose_name="段落内容")
title = models.CharField(max_length=256, verbose_name="标题", default="")
status = models.CharField(verbose_name='状态', max_length=1, choices=Status.choices,
default=Status.embedding)
Expand Down
6 changes: 3 additions & 3 deletions apps/dataset/serializers/paragraph_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ParagraphInstanceSerializer(ApiMixin, serializers.Serializer):
段落实例对象
"""
content = serializers.CharField(required=True, error_messages=ErrMessage.char("段落内容"),
max_length=4096,
max_length=102400,
min_length=1,
allow_null=True, allow_blank=True)

Expand Down Expand Up @@ -74,7 +74,7 @@ def get_request_body_api():
class EditParagraphSerializers(serializers.Serializer):
title = serializers.CharField(required=False, max_length=256, error_messages=ErrMessage.char(
"分段标题"), allow_null=True, allow_blank=True)
content = serializers.CharField(required=False, max_length=4096, allow_null=True, allow_blank=True,
content = serializers.CharField(required=False, max_length=102400, allow_null=True, allow_blank=True,
error_messages=ErrMessage.char(
"分段内容"))
problem_list = ProblemInstanceSerializer(required=False, many=True)
Expand All @@ -83,7 +83,7 @@ class EditParagraphSerializers(serializers.Serializer):
class ParagraphSerializers(ApiMixin, serializers.Serializer):
title = serializers.CharField(required=False, max_length=256, error_messages=ErrMessage.char(
"分段标题"), allow_null=True, allow_blank=True)
content = serializers.CharField(required=True, max_length=4096, error_messages=ErrMessage.char(
content = serializers.CharField(required=True, max_length=102400, error_messages=ErrMessage.char(
"分段内容"))

class Problem(ApiMixin, serializers.Serializer):
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/log/component/EditContentDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<el-input
v-model="form.content"
placeholder="请输入内容"
maxlength="4096"
maxlength="100000"
show-word-limit
:rows="8"
type="textarea"
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/log/component/EditMarkDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<el-input
v-model="form.content"
placeholder="请输入分段内容"
maxlength="4096"
maxlength="100000"
show-word-limit
:rows="15"
type="textarea"
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/paragraph/component/ParagraphForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const form = ref<any>({
const rules = reactive<FormRules>({
content: [
{ required: true, message: '请输入分段内容', trigger: 'blur' },
{ max: 4096, message: '内容最多不超过 4096 个字', trigger: 'blur' }
{ max: 100000, message: '内容最多不超过 4096 个字', trigger: 'blur' }
]
})

Expand Down
Loading