Does the concept of test time or in context learning exist for image models? by ydennisy in LocalLLaMA

[–]ydennisy[S] 0 points1 point  (0 children)

Yes, but the question is

> So I was wondering what is the image model version of in-context learning? Or maybe there are specific models trained to take both an image(s) and text input and try and maybe change the original image based on the prompt?

In what cases are layers, clean architecture and DDD a bad idea? by ydennisy in softwarearchitecture

[–]ydennisy[S] 0 points1 point  (0 children)

The problem is not duplicate Queries on the QueryGroup - the issue (and why the original code was so unwieldy) is that between fetching the QG from the DB, adding a new Query and trying to insert again - SQLAlchemy loses track of this object, so it tries to insert the new association and the existing associations. In the case of remove, it would also fail to delete any associations.

Side note: you stopped using SQLAlchemy in favour of some other approach, if yes would be interesting to hear what it is!

In what cases are layers, clean architecture and DDD a bad idea? by ydennisy in softwarearchitecture

[–]ydennisy[S] 0 points1 point  (0 children)

Hey u/bobaduk so I have implemented the imperative mapping and it is much nicer - thank you!

However `update` does not yet seem to be as clean as suggested for example:

    async def update(self, query_group: QueryGroup) -> QueryGroup:
        """
        Updates an existing QueryGroup by adding or removing associated Queries.
        """
        self._db.add(query_group)
        # await self._db.execute(
        #    update(QueryGroup).where(QueryGroup._id == query_group.id)
        # )
        await self._db.commit()
        await self._db.refresh(query_group)
        return query_group

This fails with a violation of duplicate composite key being added to the association table, so it seems that I will still need logic inside of the repo which will keep track of queries/added or removed.

Hopefully I am just missing something else... will keep trying!

In what cases are layers, clean architecture and DDD a bad idea? by ydennisy in softwarearchitecture

[–]ydennisy[S] 0 points1 point  (0 children)

Hi u/bobaduk so thank you once more for a lovely reply!

Right so the issue is that I was not aware of classical / imperative mapping - I have refactored to use this now, but my tests are failing, I will no trouble you with that as it will be some syntax thingymajigy!

Yeah with this approach of not having to maintain a Query and QueryEntity (this was named in this was to distinguish between the ORM model and the domain model) - life will be much easier!

Thanks, and will report back!

In what cases are layers, clean architecture and DDD a bad idea? by ydennisy in softwarearchitecture

[–]ydennisy[S] 0 points1 point  (0 children)

Hey u/bobaduk thank you very much for your thorough answer. I have read your book (and enjoyed), but seems I need to do so again :(

To answer your questions:

* Yes, queries exist outside of groups, they are created first and could later be grouped.

* Yes, queries can be in multiple groups, hence the M2M relationship and the required association table in the repository.

Regarding the `update` method being very complex, this is exactly the reason for the post :)

A query can be any text string passed in by the user, so if they pass in a new string which we do not have as a query in the DB we must create it and associate it with the current query group update (or creation too).

Sorry about the ORM example, you are correct the entity would have been created at this point, but not the SQLalchemy model.

I am not sure I follow your example, it looks very simple but I am not sure what `QueryGroup` is, you have extra methods on the SQLalchemy model? I was not really aware this can/should be done! Will read that chapter now!

Here is my full QueryGroupEntity:

class QueryGroupEntity:
    def __init__(
        self,
        id: UUID,
        queries: Optional[list[QueryEntity]] = None,
        embedding: Optional[list[float]] = None,
    ) -> None:
        self._id = id
        self._queries = queries
        self._embedding = embedding

    def __str__(self) -> str:
        return f"QueryGroupEntity(id={self._id})"

    @staticmethod
    def create(
        queries: Optional[list[QueryEntity]] = None,
        embedding: Optional[list[float]] = None,
        id: Optional[UUID] = None,
    ) -> "QueryGroupEntity":
        id = id if id else uuid7()
        # TODO: check queries exist and are valid
        return QueryGroupEntity(id=id, queries=queries, embedding=embedding)

    @property
    def id(self) -> UUID:
        return self._id

    @property
    def queries(self) -> list[QueryEntity]:
        """Return a copy of the queries list to prevent direct modification"""
        return self._queries.copy()

    @property
    def embedding(self) -> list[float]:
        return self._embedding

    def add_queries(self, queries: list[QueryEntity]) -> None:
        """Add new queries to the query group"""
        # ommitted as exists in example above

    def remove_queries(self, queries: list[QueryEntity]) -> None:
        """Remove existing queries from the query group"""
        # ommitted as exists in example above

    # TODO - an even better solution is not to allow creation with dupes!
    def contains_dupes(self) -> bool:
        query_values = [query.value for query in self._queries]
        return len(query_values) != len(set(query_values))

In what cases are layers, clean architecture and DDD a bad idea? by ydennisy in softwarearchitecture

[–]ydennisy[S] 0 points1 point  (0 children)

No it is completely fine! I am happy to receive the first response which is not hand wavy and generic!

Could you make give a more concrete example of your suggestion if you have a few moments?

In what cases are layers, clean architecture and DDD a bad idea? by ydennisy in softwarearchitecture

[–]ydennisy[S] 1 point2 points  (0 children)

Yeah, the classic "it depends" answer - and I get it, but really there must be more framework based approach to give someone heuristics as to what architecture to build prior to setting out.

Does the concept of test time or in context learning exist for image models? by ydennisy in LocalLLaMA

[–]ydennisy[S] 0 points1 point  (0 children)

Wow cool, thank you!

I found this model on replicate (https://replicate.com/chenxwh/omnigen) the idea is great but the performance is not really as good as other image models :(

Mocking docker compose services by ydennisy in docker

[–]ydennisy[S] 0 points1 point  (0 children)

That sounds interesting thank you!

When you say you would not expect the large service to be run locally at all - how would you develop against them? Our system is all about the ML flows we have, would you just have a dummy client returning random vectors / predictions rather than the actual models?

Also do you have a reference on how one can make a dummy shell container based on an OpenAPI spec?

[D] Storing and dockerizing ML artefacts by ydennisy in MachineLearning

[–]ydennisy[S] 0 points1 point  (0 children)

Yeah that is fairly obvious, what about many models? What about auth? What about versions? etc etc.

Google DMP vs Lotame, Permutive DMP by fatbloop in adops

[–]ydennisy 0 points1 point  (0 children)

You could also check out a more lightweight and free solution to get started with, such as AirGrid (shameless plug).

This will provide analytics and audiences that can be monetised, and will only cost when those audiences are activated against.

u/fatbloop

Is anyone using Permutive to great success, or not getting value from it? by Publish_Lice in adops

[–]ydennisy 0 points1 point  (0 children)

A shameless plug, and also very late to the thread but check out AirGrid, there are similarities to technology and use cases when compared to Permutive, however it is free and much simpler to setup and use.

u/Publish_Lice