Telegram Bot, OpenAI, and Tinygrad ๐Ÿง 

Telegram Bot, OpenAI, and Tinygrad ๐Ÿง 

Welcome to The Compiler, a daily curation of tech news

๐Ÿ›  TOOLS YOU'LL ACTUALLY USE

python-telegram-bot
Comprehensive Python wrapper for the Telegram Bot API
pip install python-telegram-bot
Stars: 23.4k, Last commit: 1 day ago

nexa-sdk
Toolkit for GGML and ONNX models supporting text/image generation, VLM, ASR, and TTS
pip install nexa-sdk
Stars: 62, Last commit: 2 days ago

openai-python
Official Python library for the OpenAI API
pip install openai
Stars: 14.7k, Last commit: 4 days ago

๐Ÿงต REPO OF THE WEEK

tinygrad
Lightweight deep learning framework in pure Python
Key feature: Implements autograd and neural networks from scratch
Recent changes: Added support for Apple Silicon, improved CUDA backend


# Simple neural network in tinygrad
from tinygrad.tensor import Tensor
import tinygrad.nn.optim as optim

class TinyNet:
  def __init__(self):
    self.l1 = Tensor.uniform(784, 128)
    self.l2 = Tensor.uniform(128, 10)

  def forward(self, x):
    return x.dot(self.l1).relu().dot(self.l2).logsoftmax()

model = TinyNet()
optim = optim.SGD([model.l1, model.l2], lr=0.001)

# Training loop
for _ in range(1000):
  out = model.forward(x_train)
  loss = out.mul(y_train).mean()
  optim.zero_grad()
  loss.backward()
  optim.step()

Thanks for reading!

Andrew Pierno

Read more