Skip to content

Feature/integration #142

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Feature/integration #142

wants to merge 16 commits into from

Conversation

TheJimmyNowak
Copy link
Collaborator

@TheJimmyNowak TheJimmyNowak commented May 22, 2024

Important change: database is inside docker on 192.168.0.4. You must change it on HOST inside .env file

@github-actions github-actions bot requested a review from Karolingo May 22, 2024 19:22
@TheJimmyNowak TheJimmyNowak marked this pull request as draft May 22, 2024 19:22
@TheJimmyNowak
Copy link
Collaborator Author

Things to repair/add:

  • celary
  • update document

@pgronkievitz pgronkievitz self-requested a review July 8, 2024 07:42
@TheJimmyNowak TheJimmyNowak changed the title Draft: Feature/integration Feature/integration Oct 11, 2024
@TheJimmyNowak TheJimmyNowak self-assigned this Oct 11, 2024
@TheJimmyNowak TheJimmyNowak marked this pull request as ready for review October 11, 2024 10:01
embeddings_body = {
"input": payload.input
}
response = requests.post("http://192.168.0.3:9000/v1/embeddings/", json=embeddings_body)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue(blocking): don't use hardcoded IPs

response = requests.post("http://192.168.0.3:9000/v1/embeddings/", json=embeddings_body)
input_embedding = response.json()['data'][0]['embedding']
similar_chunks = Chunk.objects.order_by(L2Distance('embedding', input_embedding).desc())[:5]
similar_chunks_text = "".join([chunk.text for chunk in similar_chunks])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
similar_chunks_text = "".join([chunk.text for chunk in similar_chunks])
similar_chunks_text = "".join(chunk.text for chunk in similar_chunks)

chunk_data = payload.dict()
chunk_data["document_idx"] = document_instance

response = requests.post(
url="http://0.0.0.0:9000/v1/embeddings/",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: 0.0.0.0???

@@ -28,6 +40,7 @@ def retrieve_chunk_controller(id: int) -> ChunkOut:
def update_chunk_controller(payload: ChunkIn, id: int) -> ChunkOut:
document_instance = Document.objects.get(pk=payload.document_idx)

# TODO: Embeddings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add issue and link to it in here

@@ -15,12 +16,21 @@ def split_document_into_chunks(
document: Document, chunk_size: int = 100
) -> list[ChunkData]:
"""Splits document into chunks of size chunk_size and returns them as ChunkData objects."""

def batched(iterable, n):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typing

async def chatknml(ctx: commands.Context, *, prompt: str):
"""Passes the prompt to the llm and returns the answer."""
result = query_llm(prompt)
await ctx.send("HEJ" + result)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Comment on lines +17 to +19
networks:
inner:
ipv4_address: 192.168.0.4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DO FUCKING NOT
use built-in DNS (if you're using podman, you'll require one addon to make it work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants