Detailed writeup: https://huggingface2.notion.site/How-to-split-Flux-transformer-and-run-inference-aa1583ad23ce47a78589a79bb9309ab0
But TLDR is we split the models where possible and decouple the different stages of pipeline
<? | |
// | |
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio) | |
// | |
// File: twitterFollowerCuratorBot.php | |
// | |
// Created: May 2021 | |
// License: MIT | |
// |
#!/bin/bash | |
# Check if a GitHub URL is provided as an argument | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <github_url>" | |
exit 1 | |
fi | |
# Store the GitHub URL | |
GIT_URL="$1" |
Detailed writeup: https://huggingface2.notion.site/How-to-split-Flux-transformer-and-run-inference-aa1583ad23ce47a78589a79bb9309ab0
But TLDR is we split the models where possible and decouple the different stages of pipeline
""" | |
A minimal, fast example generating text with Llama 3.1 in MLX. | |
To run, install the requirements: | |
pip install -U mlx transformers fire | |
Then generate text with: | |
python l3min.py "How tall is K2?" |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.draw.drawWithContent | |
import androidx.compose.ui.geometry.Offset | |
import androidx.compose.ui.graphics.BlendMode | |
import androidx.compose.ui.graphics.Color | |
import androidx.compose.ui.graphics.nativeCanvas | |
@Composable |
@Composable | |
fun ParallaxScreen(modifier: Modifier = Modifier) { | |
val context = LocalContext.current | |
val scope = rememberCoroutineScope() | |
var data by remember { mutableStateOf<SensorData?>(null) } | |
DisposableEffect(Unit) { | |
val dataManager = SensorDataManager(context) | |
dataManager.init() |
extension CGRect | |
{ | |
/** Creates a rectangle with the given center and dimensions | |
- parameter center: The center of the new rectangle | |
- parameter size: The dimensions of the new rectangle | |
*/ | |
init(center: CGPoint, size: CGSize) | |
{ | |
self.init(x: center.x - size.width / 2, y: center.y - size.height / 2, width: size.width, height: size.height) |
private val PARTICLE_COLOR = Color.White | |
private val LINE_COLOR = Color.White | |
private const val PARTICLE_QUANTITY = 100 | |
private const val DEFAULT_SPEED = 2 | |
private const val VARIANT_SPEED = 1 | |
private const val DEFAULT_RADIUS = 4 | |
private const val VARIANT_RADIUS = 2 | |
private const val LINK_RADIUS = 200 | |
// TODO: 30/09/2020 These should be measured but are only used to calculate | |
// the initial position |
package com.alexjlockwood.circularprogressindicator | |
import android.os.Bundle | |
import android.view.animation.PathInterpolator | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.compose.animation.core.* | |
import androidx.compose.animation.transition | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.layout.fillMaxHeight | |
import androidx.compose.foundation.layout.fillMaxWidth |
final class Completion<R> { | |
private let closure: (R) -> Void | |
private var cancelled = false | |
/// `closure` is called upon completion, if not cancelled. | |
init(closure: (R) -> Void) { | |
self.closure = closure | |
} | |