This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from transformers import AutoTokenizer | |
from trl import GRPOConfig, GRPOTrainer | |
import re | |
import wandb | |
import accelerate | |
from math_verify import parse, verify, ExprExtractionConfig | |
from datasets import load_dataset, Dataset | |
accelerator = accelerate.Accelerator() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import modal | |
from modal import Image | |
from evals import EVALUATIONS_CONFIGS | |
from evals.runner import run_eval | |
GPU_TYPE = "L4" | |
# Create Modal app | |
app = modal.App(name="eval_scorers") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass | |
import simple_parsing as sp | |
from typing import Literal | |
import modal | |
from modal import Image | |
from evals import EVALUATIONS_CONFIGS | |
from evals.runner import run_eval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder