Skip to content

Instantly share code, notes, and snippets.

from transformers import pipeline
# Qwen/Qwen2.5-0.5B
# EleutherAI/pythia-410m
# HuggingFaceTB/SmolLM2-360M
# Qwen/Qwen2-1.5B
# Qwen/Qwen2.5-1.5B
gen = pipeline("text-generation", model="Qwen/Qwen2.5-1.5B")
prompt = "The best university in the world is"
@danyaljj
danyaljj / examples.py
Created July 24, 2026 15:38
ICL examples
from transformers import pipeline
# Qwen/Qwen2.5-0.5B
# EleutherAI/pythia-410m
# HuggingFaceTB/SmolLM2-360M
# Qwen/Qwen2-1.5B
# Qwen/Qwen2.5-1.5B
gen = pipeline("text-generation", model="Qwen/Qwen2.5-1.5B")
prompt = "The best university in the world is"
@danyaljj
danyaljj / 1.split_conversations.py
Created July 7, 2026 20:31
1.split_conversations.py
"""
Split messages JSON into one file per conversation (turn).
Usage:
python analysis/1.split_conversations.py messages_202606221221.json [output_dir] [--since 2026-06-01]
Each file is named: YYYY-MM-DDTHH-MM_<slug>.json
The trace payloads are fully deserialized — no double-JSON-encoded strings.
"""
"""
Split messages JSON into one file per conversation (turn).
Usage:
python analysis/1.split_conversations.py messages_202606221221.json [output_dir] [--since 2026-06-01]
Each file is named: YYYY-MM-DDTHH-MM_<slug>.json
The trace payloads are fully deserialized — no double-JSON-encoded strings.
"""
@danyaljj
danyaljj / powerpointpdf.bas
Created June 30, 2026 21:55 — forked from keerekeerweere/powerpointpdf.bas
powerpoint split slides containing animations in separate slides for pdf exort and printing
Option Explicit
Sub AddElements()
Dim shp As Shape
Dim i As Integer, n As Integer
n = ActivePresentation.Slides.Count
For i = 1 To n
Dim s As Slide
Set s = ActivePresentation.Slides(i)
import requests
PAPER_ID = "0a2c5dfa8b273c0130a0b59be7ce5dba575303be"
BASE_URL = "https://api.semanticscholar.org/graph/v1"
S2_API_KEY = "..."
HEADERS = {"x-api-key": S2_API_KEY}
PAPER_FIELDS = "title,abstract,year,authors,citationCount,referenceCount,externalIds,venue,publicationDate"
REF_FIELDS = "title,authors,year,citationCount,externalIds"
{
"Health & Clinical Sciences": {
"Dentistry": {
"General Dentistry": [
"Dental Research and COVID-19"
],
"Oral Surgery": [
"Dental Anxiety and Anesthesia Techniques",
"Dental Implant Techniques and Outcomes",
"Dental Radiography and Imaging",
Dataset / Platform Scope (what it includes) Approx. size Bulk access License / reuse for products & demos
Semantic Scholar Open Research Corpus (S2ORC) Papers (metadata, abstracts, references); full text only for OA subset ~80M papers; ~8–12M full text Static snapshots (≤2020) + AP
from itertools import permutations
import numpy as np
from collections import defaultdict
from scipy.stats import kendalltau
# Define the input rankings: each ranking is a list from most to least preferred
rankings = [
['A', 'B', 'C'],
['B', 'C', 'A'],
['C', 'A', 'B']
import numpy as np
import matplotlib.pyplot as plt
# Set seed for reproducibility
np.random.seed(123)
# Parameters
T = 10000 # number of time steps
s = 0.01 # step size
dim = 2 # 2D space