git clone git@github.com:filipstrand/mflux.git
cd mflux && pip install -r requirements.txtName this anything, maybe flux.py. Make sure to update the two paths marked below.
| import mlx.core as mx | |
| import mlx.nn as nn | |
| from typing import Tuple, Type, Optional, List, Any | |
| import importlib | |
| from transformers import AutoTokenizer | |
| from mlx_lm.utils import load_model, get_model_path | |
| def get_qwen3_embedding_classes(config: dict) -> Tuple[Type[nn.Module], Type]: |
| import time | |
| from typing import Literal | |
| import outlines | |
| import re | |
| import torch | |
| from transformers import AutoTokenizer | |
| from outlines.fsm.json_schema import convert_json_schema_to_str | |
| from outlines_core.fsm.json_schema import build_regex_from_schema | |
| from pydantic import BaseModel |
| task projectDependencyGraph { | |
| doLast { | |
| def plantuml = new File(rootProject.buildDir, 'reports/dependency-graph/project.puml') | |
| plantuml.parentFile.mkdirs() | |
| plantuml.delete() | |
| plantuml << '@startuml\n' | |
| plantuml << "!define blue #00E489\n" | |
| plantuml << "!define origin #FF8A65\n" | |
| plantuml << "!define green #1A73E8\n" |
| // This script is used to initialize the build in a module or plugin project. | |
| // During this phase, the script applies the Maven plugin and configures the | |
| // destination of the local repository. | |
| // The local repository will contain the AAR and POM files. | |
| void configureProject(Project project, String mavenUrl, String mavenUser, String mavenPwd, String version) { | |
| if (!project.hasProperty("android")) { | |
| throw new GradleException("Android property not found.") | |
| } | |
| if (!project.android.hasProperty("libraryVariants")) { |
| val miles = 1.kilometers.to(Distance.Mile) | |
| val kilometers = 1.miles.to(Distance.Kilometer) | |
| val total = 2.kilometers + 1.miles + 10.meters + 1.centimeter + 1.millimeter | |
| Log.d("MainActivity", "Total distance is ${total.meters.amount} meters") | |
| val totalTime = 2.hours + 2.minutes + 2.seconds + 2.milliseconds | |
| Log.d("MainActivity", "Total time is ${totalTime.amount} ${totalTime.unit}") |
| /* | |
| * Copyright (C) 2009 The Android Open Source Project | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.