-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/content to embedding model #18
base: develop
Are you sure you want to change the base?
Conversation
70ade3e
to
65c2884
Compare
.flake8
Outdated
@@ -7,3 +7,4 @@ max-complexity = 10 | |||
per-file-ignores = | |||
/**/tests/*_mock_data.py: E501 | |||
**/snap_test_*.py: E501 | |||
/**/apps.py: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore a line not the file itself.
CELERY_BROKER_URL = "redis://redis:6379/0" | ||
CELERY_RESULT_BACKEND = "redis://redis:6379/0" | ||
CELERY_ACCEPT_CONTENT = ["json"] | ||
CELERY_TASK_SERIALIZER = "json" | ||
CELERY_RESULT_SERIALIZER = "json" | ||
CELERY_TIMEZONE = "UTC" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this?
docker-compose.yml
Outdated
depends_on: | ||
- redis | ||
- web |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What?
depends_on: | ||
- db | ||
- redis | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
volumes: | ||
- .:/code | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content/tasks.py
Outdated
from .models import Content | ||
|
||
content = Content.objects.get(id=content_id) | ||
url = settings.EMBEDDING_MODEL_URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use it directly.
content/signals.py
Outdated
|
||
@receiver(post_save, sender=Content) | ||
def content_handler(sender, instance, created, **kwargs): | ||
create_embedding_for_content_task.delay(instance.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this to save, but for future use ModelForm (which will then be used in serializers)
content/tasks.py
Outdated
for i in range(len(split_docs)) | ||
] | ||
if response.status_code == 200: | ||
db = QdrantDatabase(host="qdrant", port=settings.QDRANT_DB_PORT, collection_name=settings.QDRANT_DB_COLLECTION_NAME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this? host="qdrant"
db.store_data(zip(response.json(), metadata)) | ||
content.document_status = Content.DocumentStatus.ADDED_TO_VECTOR | ||
else: | ||
content.document_status = Content.DocumentStatus.FAILURE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is save?
data = OllamaHandler() | ||
serializer = UserQuerySerializer(data=request.data) | ||
if serializer.is_valid(): | ||
result = data.execute_chain(request.data["query"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check and add a note if we need async here?
89759ba
to
dcec82c
Compare
dcec82c
to
dc621cf
Compare
Addresses
Changes
This PR doesn't introduce any:
print
This PR contains valid: