Created
February 26, 2025 11:34
-
-
Save KaQuMiQ/dc70c2982563c4cdeea825829ad7088d to your computer and use it in GitHub Desktop.
Przepis na sękacza w JSON od Bielika
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! uv -n run | |
| # /// script | |
| # requires-python = ">=3.12" | |
| # dependencies = [ | |
| # "draive[ollama]~=0.43.1", | |
| # ] | |
| # /// | |
| from asyncio import run | |
| from collections.abc import Sequence | |
| from draive import DataModel, Field, Step, ctx, setup_logging, steps_completion | |
| from draive.ollama import Ollama, OllamaChatConfig | |
| setup_logging("bielik") | |
| class Recipe(DataModel): | |
| name: str = Field(description="Nazwa przepisu") | |
| description: str = Field(description="Opis potrawy, jej walory i historia") | |
| ingredients: Sequence[str] = Field(description="Wymagane składniki") | |
| preparation: str = Field(description="Proces przygotowania") | |
| async def main() -> None: | |
| ollama = Ollama() | |
| async with ctx.scope( | |
| "bielik", | |
| ollama.lmm_invoking(), | |
| OllamaChatConfig( | |
| model="SpeakLeash/bielik-11b-v2.3-instruct:Q4_K_M", | |
| temperature=0.7, | |
| ), | |
| disposables=[ollama], | |
| ): | |
| result = await steps_completion( | |
| Step.of( | |
| "Jak przygotować sękacza?", | |
| instruction="Jesteś kucharzem podającym przepisy na wybrane potrawy zgodnie ze schematem.", | |
| output=Recipe, | |
| ) | |
| ) | |
| print(result) | |
| run(main()) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Przykładowy wynik dla modelu Q8_0
name:
Sękacz
description:
Tradycyjne, wędzone ciasto z kawałkami orzechów i miodem. Przygotowanie sękacza jest dość czasochłonne, ale warto się postarać, ponieważ efekt końcowy jest pyszny.
ingredients:
preparation: