Skip to content

Instantly share code, notes, and snippets.

@vukrosic
vukrosic / qwen3_from_scratch.ipynb
Last active March 14, 2026 13:03
qwen3_from_scratch.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@umtksa
umtksa / qwen3.py
Last active September 1, 2025 18:57
Qwen3-0.6B finetune
from datasets import load_dataset
from transformers import (
AutoTokenizer, AutoModelForCausalLM,
TrainingArguments, Trainer, DataCollatorForSeq2Seq,
set_seed
)
from peft import LoraConfig, get_peft_model, TaskType
import torch
set_seed(42)
@scturtle
scturtle / qwen3.py
Last active September 1, 2025 18:58
qwen3
import os
from functools import lru_cache
import torch
from torch import nn
import torch.nn.functional as F
from transformers import Qwen3Config
from transformers import Qwen2TokenizerFast
@TomMarius
TomMarius / candle_qwen3.rs
Last active September 1, 2025 18:57
Minimal Candle Rust text inference example with quantized Qwen3
use candle::{Device, Tensor, quantized::gguf_file};
use candle_transformers::{
generation::{LogitsProcessor, Sampling},
models::quantized_qwen3::ModelWeights as Qwen3,
};
use std::{
fs::File,
io::{self, Write},
};
use tokenizers::Tokenizer;
@CoffeeVampir3
CoffeeVampir3 / example.rs
Created May 30, 2024 01:41
Rust Candle Inference Examples
use std::io::Write;
use tokenizers::Tokenizer;
use candle_core::quantized::{gguf_file};
use candle_core::Device;
use candle_transformers::generation::{LogitsProcessor, Sampling};
use candle_transformers::models::quantized_llama as model;
use model::ModelWeights;
use burnt_wick::streamable_model::StreamableModel;
fn load_model_and_tokenizer(
@mara004
mara004 / pypdfjs.py
Last active March 17, 2026 14:38
PDF rendering with pdf.js, from Python
# Four lines intentionally left blank
# SPDX-FileCopyrightText: 2025 geisserml <geisserml@gmail.com>
# SPDX-License-Identifier: Apache-2.0 OR MPL-2.0
# See also https://github.com/extremeheat/JSPyBridge/blob/master/examples/python/pdfjs.py
@tkaravou
tkaravou / SwiftCalendarView.swift
Last active September 29, 2022 13:06
How to add an event to a Calendar using Swift/SwiftUI
// You will need to add `Privacy - Calendars Usage Description` as a key in your plist file.
// If you don't have a plist file, click on your project's name > Info and add the key there
// The value should be a brief description as to why you need access to the calendar
// This gist will create the event as soon as the view is loaded
// You'll want to attach it to a button or an action instead
// Place the following code in one of your SwiftUI View files
let store = EKEventStore()

Moved to repo: /quenhus/uBlock-Origin-dev-filter

In order to keep filters up to date, please use this repo.

@abeytom
abeytom / vscode_shortcuts.md
Created December 6, 2021 15:31
VS Code shortcuts for the corresponding Intellij Idea shortcuts
Desc vscode intellij
Find Actions / Cmd Pallete Cmd+Shift+P Cmd+Shift+A
Toggle Sidebar Cmd+B Cmd+1
View File in Sidebar Cmd+Shift+E Alt+F1,1
Open File From Sidebar Cmd+Down Enter
Open File Cmd+P Cmd+Shift+N
New File Cmd+N Ctrl+Enter
Move Line Up Shift+Opt+Up Shift+Opt+Up
Move Line Down Shift+Opt+Up Shift+Opt+Down
/* global __DEV__ */
import React, { useState, useEffect, useRef } from "react"
import {
facebookAppId,
facebookDisplayName,
iosOneSignalAppId,
androidOneSignalAppId,
sentryDsn,
} from "./app.json"
import { version } from "./package.json"