Skip to content
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

Improved interaction with exposed models #33

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

Conversation

MatsMoll
Copy link
Owner

@MatsMoll MatsMoll commented Feb 1, 2025

A lot of clean up and improved interactions with exposed models. Such as MLFlow, partitions etc.

@feature_view(source=FileSource.parquet_at("recipes.parquet"))
class Recipes:
    recipe_id = Int32().as_entity()
    name = String()

@model_contract(
    input_features=[ Recipes().name ],
    exposed_model=ollama_extraction(model="mistral:latest")
)
class RecipeMainIngredients:
    recipe_id = Int32().as_entity()
    response = String().as_prompt_completion()
    model_version = String().as_model_version()

    protein = String().description(
        "The main source of protein in the recipe"
    )
    carbohydrate = String().description(
        "The main source of carbohydrates in the recipe"
    )

store = ContractStore.from_contracts([Recipes, RecipeMainIngredients])
df = await store.model(RecipeMainIngredients).predict_over({
    "recipe_id": [1, 2, 3, 4, 5]
}).to_polars()
print(df)

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.

1 participant