Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 requests | |
from datetime import datetime, timedelta | |
# URL to fetch data from | |
url = "https://workshops.birs.ca/events/future.json" | |
def get_nearest_monday(given_date): | |
weekday = given_date.weekday() |
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
curl http://localhost:11434/api/chat -d '{ | |
"model": "llama3.2", | |
"messages": [ | |
{ | |
"role": "user", | |
"content": "What is the weather today in Banff, Alberta?" | |
} | |
], | |
"stream": false, | |
"tools": [ |
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 json | |
import ollama | |
import asyncio | |
import sqlite3 | |
def get_workshop(workshop: str) -> str: | |
workshops = { | |
"24w5302": { | |
"Title": "Community in Algebraic and Enumerative Combinatorics", | |
"Arrival Date": "01/07/2024", |
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 sqlite3 | |
import sqlite_vec | |
from typing import List | |
import struct | |
def serialize_f32(vector: List[float]) -> bytes: | |
"""serializes a list of floats into a compact "raw bytes" format""" | |
return struct.pack("%sf" % len(vector), *vector) |
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 | |
import chromadb | |
from chromadb.utils import embedding_functions | |
from car_data_etl import prepare_car_reviews_data | |
from chroma_utils import build_chroma_collection | |
import openai | |
DATA_PATH = "data/archive/*" | |
CHROMA_PATH = "car_review_embeddings" | |
EMBEDDING_FUNC_NAME = "multi-qa-MiniLM-L6-cos-v1" |
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 ollama | |
target_images = ['1.jpg'] | |
questions = [ 'What is in this image?', | |
'Is this a slide show presentation?', | |
'Is the person teaching? (YES/NO): ', | |
'Is a person drawing on the green chalk board? (YES/NO): ', | |
'Is a person in the scene? (YES/NO): ' | |
] |
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 ollama | |
import chromadb | |
documents = [ | |
"Llamas are members of the camelid family meaning they're pretty closely related to vicuñas and camels", | |
"Llamas were first domesticated and used as pack animals 4,000 to 5,000 years ago in the Peruvian highlands", | |
"Llamas can grow as much as 6 feet tall though the average llama between 5 feet 6 inches and 5 feet 9 inches tall", | |
"Llamas weigh between 280 and 450 pounds and can carry 25 to 30 percent of their body weight", | |
"Llamas are vegetarians and have very efficient digestive systems", | |
"Llamas live to be about 20 years old, though some only live for 15 years and others live to be 30 years old", |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder