Skip to content

Instantly share code, notes, and snippets.

View tcapelle's full-sized avatar
😄
happy

Thomas Capelle tcapelle

😄
happy
View GitHub Profile
@tcapelle
tcapelle / eval_modal.py
Last active January 13, 2025 20:41
Evaluation on Modal
# put your wandb api key in the modal secrets
# >modal run eval_latency_modal.py
import time
import logging
import numpy as np
from rich.console import Console
from rich.table import Table
import modal
from modal import Image
@tcapelle
tcapelle / bs_blocker.py
Last active November 30, 2024 07:14
A Bluesky auto blocker with AI moderation
# pip install weave openai atproto rich
import os
import openai
import weave
from atproto import Client
from rich.console import Console
from rich.rule import Rule
from datetime import datetime, timedelta, timezone
import warnings
@tcapelle
tcapelle / call_llama90.py
Created October 15, 2024 15:39
Simple script to call Llama 90b
import os, openai, weave
MODEL = "meta-llama/Llama-3.2-90B-Vision-Instruct"
weave.init("llama32_90B_EU")
image_url = "https://www.hachette.fr/sites/default/files/webmasters/l023-1.png"
llama_client = openai.OpenAI(
base_url="http://195.242.25.198:8032/v1",
api_key=os.environ.get("WANDB_API_KEY")
@tcapelle
tcapelle / llama32.py
Last active September 27, 2024 17:00
import os, openai, weave
MODEL = "Llama-3.2-90B-Vision-Instruct"
weave.init("EU_HAS_LLAMA_90B")
image_url = "https://limaspanishhouse.com/wp-content/uploads/2021/02/peruvian-llama-2-1536x1346.jpg"
llama_client = openai.OpenAI(
base_url="http://195.242.25.198:8032/v1",
api_key=os.environ.get("WANDB_API_KEY")
import asyncio
import os
import base64
from pathlib import Path
from mistralai import Mistral
image_path = "test_24915.jpg"
temperature = 0.0
max_tokens = None
@tcapelle
tcapelle / pixtral.py
Last active September 24, 2024 13:59
from mistralai import Mistral
import os
import weave
weave.init("pixtral")
print("1. La Platforme Mistral")
api_key = os.environ["MISTRAL_API_KEY"]
model = "pixtral-12b-2409"
@tcapelle
tcapelle / weave_docs_dump.py
Last active July 31, 2024 13:19
Dump all weave docs into a single MD file
from dataclasses import dataclass
from pathlib import Path
import simple_parsing
# clone weave:
# git clone https://github.com/wandb/weave
WEAVE_DOCS_PATH = Path("weave/docs/docs")
@dataclass
name: Build and Test Locally
on:
workflow_dispatch: #allows repo admins to trigger this workflow from the Actions tab
inputs:
create_github_issue:
type: boolean
description: 'Create issues on failing notebooks'
default: false
nbs_list:
type: choice
@tcapelle
tcapelle / useful_stuff.md
Last active November 8, 2023 16:59
Useful Command and more

Linux

Setup

When setting up a fresh VM.

sudo apt update
sudo apt-get install vim tmux wget
@tcapelle
tcapelle / wine_list.md
Last active October 26, 2023 15:41
Wine List in France

My Personal Top Wines: by Region

This is an arbitrary good list of wines I like, don't be offended if your favorite wine is not there. I have limited tasting time, and have mostly choose little family owned producers

Everything here is Organic, most are biodynamic and some are natural.

I have visited most of the winerys myself, and now I order directly from them or by my local wine-shop that actually helps me find more wine of this quality.

Loire

Probably my fav white wine region, I love the floral and sometimes minerality of these wines. There is always a good reason to open any of these bottles. It is also a very beautiful region to visit where you find accomodation on old castles like Chteau de Beaujeu.