This file contains hidden or 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 | |
import logging | |
logger = logging.getLogger() | |
from pydantic import BaseModel | |
def pydantic_model_to_custom_json_schema(model: type[BaseModel], name: str, strict: bool = True) -> dict: | |
""" | |
Converts a Pydantic model to a custom JSON schema format. | |
""" |
This file contains hidden or 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 langchain_google_genai import ChatGoogleGenerativeAI | |
import os | |
llm = ChatGoogleGenerativeAI( | |
model="gemini-2.0-flash-001", | |
temperature=0, | |
max_tokens=None, | |
timeout=None, | |
max_retries=2, | |
) |
This file contains hidden or 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 python:3.8 | |
WORKDIR /usr/local/lib/python3.8/site-packages | |
RUN pip install evidently |
This file contains hidden or 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 datetime import datetime | |
from contextlib import contextmanager | |
class DummyStatsd: | |
def increment(self, event, tags=None): | |
print("*" * 80) | |
print(f"DummyStatsd.increment(event={event}, tags={tags})") | |
print("*" * 80) | |
def histogram(self, event, value, tags=None): |
This file contains hidden or 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
brew install graphviz | |
export CFLAGS="-I $(brew --prefix graphviz)/include" | |
export LDFLAGS="-L $(brew --prefix graphviz)/lib" | |
pip install pygraphviz |
This file contains hidden or 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 typing import Any | |
import unittest | |
class Delegator: | |
def __init__(self, instance, method_name): | |
self.instance = instance | |
self.method_name = method_name | |
def __getattr__(self, name): | |
if name == self.method_name: |
This file contains hidden or 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 json | |
import sys | |
import os | |
import urllib.request | |
match = sys.argv[1] | |
filepath = "https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json"#sys.argv[2] | |
def get_versions(filepath): | |
if os.path.exists(filepath): |
This file contains hidden or 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 langchain.callbacks.manager import AsyncCallbackManager | |
import os, logging | |
logger = logging.getLogger(__name__) | |
stream_manager = AsyncCallbackManager([]) | |
from langchain_google_vertexai import VertexAIModelGarden | |
from typing import Any, List, Optional |
This file contains hidden or 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
""" | |
I found myself waiting for LLM model to give me result. My result is always the same since I am working on the lower level library. | |
Example | |
@memoize("test.pkl") | |
def sum(x, y): | |
return x + y | |
""" |
This file contains hidden or 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 nvidia/cuda:11.2.2-runtime-ubuntu20.04 | |
RUN apt-get update --yes --quiet | |
RUN apt install software-properties-common -y && add-apt-repository ppa:deadsnakes/ppa -y && \ | |
apt-get install -y python3.10 \ | |
pip \ | |
python3.10-distutils \ | |
curl | |
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 |
NewerOlder