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
import io | |
import json | |
from typing import Any, cast | |
import requests | |
from transformers import AutoProcessor, Gemma3ForConditionalGeneration | |
from transformers import TrainingArguments | |
from trl import SFTTrainer, SFTConfig | |
from peft.tuners.lora.config import LoraConfig | |
from datasets import IterableDataset, Features | |
import datasets |
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
Client code: | |
let mut buff = [0; 65000]; | |
log::info!("Handshaking"); | |
let (mut send, mut recv) = connection.connection.open_bi().await.unwrap(); | |
send.write_all(b"hello").await.unwrap(); | |
recv.read(&mut buff).await.unwrap(); // Discard hello message | |
log::info!("Synchronizing time"); | |
let time = Instant::now(); |
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
use tokio::{runtime::Builder, sync::{mpsc}}; | |
use winit::{event::{Event, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::{Window, WindowBuilder}}; | |
pub struct Gpu { | |
pub surface: wgpu::Surface, | |
pub device: wgpu::Device, | |
pub queue: wgpu::Queue, | |
pub sc_desc: wgpu::SwapChainDescriptor, | |
pub swap_chain: wgpu::SwapChain, |
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
extern crate log; | |
extern crate futures; | |
extern crate deno_core; | |
extern crate tokio; | |
use deno_core::serde_json; | |
use deno_core::CoreIsolate; | |
use deno_core::CoreIsolateState; | |
use deno_core::ErrBox; | |
use deno_core::Script; |
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
export function mutateAbilitySlots(abilitySlotsSize: number, maxColorAttachements: number) { | |
return multilayerShaderSource(maxColorAttachements, | |
` | |
uniform sampler2DArray cellProperties; | |
uniform sampler2D cleanCopyMove; | |
uniform float noiseSeedModify; | |
uniform float noiseSeedAmount; | |
uniform float mutateChance; |
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
float flowEffect(vec2 texcoord, sampler2DArray source, int sourceLayer, int groundLayer, vec2 texelSize, float amount) { | |
float v0 = texture(source, vec3(texcoord + vec2(-texelSize.x, -texelSize.y), sourceLayer)).r; | |
float v1 = texture(source, vec3(texcoord + vec2(0, -texelSize.y), sourceLayer)).r; | |
float v2 = texture(source, vec3(texcoord + vec2(texelSize.x, -texelSize.y), sourceLayer)).r; | |
float v3 = texture(source, vec3(texcoord + vec2(-texelSize.x, 0), sourceLayer)).r; | |
float v4 = texture(source, vec3(texcoord + vec2(0, 0), sourceLayer)).r; | |
float v5 = texture(source, vec3(texcoord + vec2(texelSize.x, 0), sourceLayer)).r; | |
float v6 = texture(source, vec3(texcoord + vec2(-texelSize.x, texelSize.y), sourceLayer)).r; |
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
import * as React from 'react'; | |
export interface MeasureSizeProps { | |
onResize?: (size: number[]) => void; | |
} | |
export class MeasureSize extends React.Component<MeasureSizeProps, null> { | |
componentDidMount() { | |
this.dispatchResize(); | |
} |