Skip to content

Instantly share code, notes, and snippets.

@vukrosic
vukrosic / qwen3_from_scratch.ipynb
Last active April 29, 2026 12:38
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.
@willccbb
willccbb / REPORT.md
Created March 9, 2025 18:30
Claude Deep Research: ARC-AGI
@willccbb
willccbb / grpo_demo.py
Last active April 17, 2026 04:37
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
"""
citation:
@misc{brown2025grpodemo,
title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models},
author={Brown, William},
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Reinforcement Learning for Finance

Workshop at ODSC London 2024

Dr. Yves J. Hilpisch | The Python Quants | CPF Program

London, 06. September 2024

(short link to this Gist: http://bit.ly/odsc_ldn_2024)

Fine-tuning llama 2 7B to analyze financial reports and write “funny” tweets

Sharing some insights from a recent weekend fun project where I tried to analyze and summarize financial reports using a fine-tuned LLM.

My initial goal was to train a model to summarize the annual/quarterly financial reports of public companies (aka 10-K / 10-Q). But, realizing that straightforward financial summaries are boring, I thought of tuning LLM to generate sarcastic summaries of these reports. Something short I could post on Twitter.

Data exploration and dataset prep

Working with financial reports ain’t easy. You download them in html format, they’re pretty dense with ~100 pages filled with tables that can be tough to parse, many legal disclaimers and various useless info. I knew I wanted to get 3-5 funny tweets as an output from a report. But I spent quite some time figuring out what data to actually input to get the result - a page, a section, a table?

@miagkyi
miagkyi / 10k_reports_to_tweets.py
Last active January 12, 2025 14:10
Create funny tweets from 10k/q financial reports using gpt
from datetime import datetime, timedelta
import concurrent.futures
import csv
import html
import os
import time
from bs4 import BeautifulSoup
from dotenv import load_dotenv
import nltk
@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active March 31, 2026 08:26
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# 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
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--base_model_name_or_path", type=str)