-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Feature/integration #142
Conversation
Things to repair/add:
|
embeddings_body = { | ||
"input": payload.input | ||
} | ||
response = requests.post("http://192.168.0.3:9000/v1/embeddings/", json=embeddings_body) |
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.
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]) |
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.
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/", |
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.
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 |
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.
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): |
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.
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) |
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.
???
networks: | ||
inner: | ||
ipv4_address: 192.168.0.4 |
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.
DO FUCKING NOT
use built-in DNS (if you're using podman, you'll require one addon to make it work)
Important change: database is inside docker on 192.168.0.4. You must change it on
HOST
inside.env
file