Skip to content

Instantly share code, notes, and snippets.

View albertdbio's full-sized avatar

Albert albertdbio

View GitHub Profile
@albertdbio
albertdbio / App.tsx
Created March 2, 2025 01:12 — forked from kallebysantos/App.tsx
Running Local AI models with FastAPI and Vercel AI SDK
import "./App.css";
import { useEffect, useState } from "react";
import { useCompletion } from "ai/react";
function App() {
const [apiResponse, setApiResponse] = useState("");
useEffect(() => {
fetch("/api/reply?value=Hello from React App!")
.then((response) => response.json())
@albertdbio
albertdbio / grpo_demo.py
Created January 30, 2025 23:40 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
# Swift Language Fundamentals
Swift is a modern programming language for Apple platforms (iOS, macOS, etc.) with these key characteristics:
1. Core Features:
- Type inference for automatic type detection
- Optionals for safe handling of missing values
- Closures for flexible function passing
- Memory safety by design
- Built-in error handling