Skip to content

Instantly share code, notes, and snippets.

View BexTuychiev's full-sized avatar
🏠
Working from home

bexgboost BexTuychiev

🏠
Working from home
View GitHub Profile
@BexTuychiev
BexTuychiev / notebook_to_docx.py
Created February 18, 2026 12:33
Notebook to DOCX converter - converts Jupyter notebooks to Word documents with proper formatting
#!/usr/bin/env python3
"""
Notebook to DOCX Converter
Converts Jupyter notebooks to Word documents with proper formatting:
- Markdown formatting preserved as Word styles
- Backticks preserved around inline code
- Code blocks with triple backticks visible, Courier New font
- Non-code text in Poppins font
- Images with alt text built-in
@BexTuychiev
BexTuychiev / agent.py
Created February 16, 2026 12:24
Complete voice assistant with Gemini Live API, Firecrawl web search, and Gmail - companion code for the tutorial
"""
Voice assistant with Gemini Live API, Firecrawl web search, and Gmail integration
"""
import asyncio
import os
import smtplib
from email.mime.text import MIMEText
from livekit.agents import (
@BexTuychiev
BexTuychiev / docker-compose.yaml
Created February 14, 2026 19:47
Mem0 self-hosted Docker Compose stack
name: mem0-selfhost
services:
mem0:
build: .
image: mem0-selfhost:latest
ports:
- "8888:8000"
env_file:
- .env
@BexTuychiev
BexTuychiev / lstm_builtin.py
Created February 4, 2026 10:34
LSTM Sentiment Classifier for IMDB Reviews - PyTorch Implementation
"""
PyTorch Built-in LSTM for IMDB Sentiment Classification
Demonstrates nn.LSTM with a real NLP task.
"""
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, TensorDataset
from datasets import load_dataset
from collections import Counter
import asyncio
from pyppeteer import launch
import json
async def scrape_quotes():
browser = await launch(headless=True)
page = await browser.newPage()
await page.setViewport({"width": 1920, "height": 1080})
from playwright.sync_api import sync_playwright
import json
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page(viewport={"width": 1920, "height": 1080})
base_url = "https://quotes.toscrape.com/js/page/{}/"
all_quotes = []
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from webdriver_manager.chrome import ChromeDriverManager
import json
# Configure headless Chrome
{
"metadata": {
"finetuned_checkpoint": "tinker://8f13c8d2-d406-4533-810a-268360972ff6/sampler_weights/fincot-checkpoint-400",
"base_model": "qwen/qwen3-8b",
"judge_model": "openai/gpt-4o",
"total_questions": 10
},
"summary": {
"avg_score_finetuned": 8.5,
"avg_score_base": 6.5,
"""
Model Comparison Script: Fine-tuned Tinker Model vs Base Qwen3-8B
Uses Kimi K2 Thinking as an unbiased judge to evaluate responses to financial questions.
"""
import os
import json
import time
import requests
from dotenv import load_dotenv
"""
Tinker Financial Q&A Fine-Tuning with FinCoT Dataset
Uses chain-of-thought reasoning dataset for improved answer quality
Includes validation tracking, warmup, and proper checkpoint management
"""
import time
import numpy as np
from dotenv import load_dotenv
from datasets import load_dataset