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 | |
app = modal.App(name="moondream-label-datikz_v2") | |
data_dict = modal.Dict.from_name("HF_DATASET", create_if_missing=True) | |
def download_dataset(): | |
from datasets import load_dataset | |
data_dict["HF_DATASET"] = "nllg/datikz-v2" | |
dataset = load_dataset(data_dict["HF_DATASET"]) |
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 AutoModelForCausalLM, AutoTokenizer | |
import xxhash | |
from tqdm import tqdm | |
# load moondream model | |
model_id = "vikhyatk/moondream2" | |
revision = "2024-05-20" | |
model = AutoModelForCausalLM.from_pretrained( |
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 | |
app = modal.App(name="pokemon-eval") | |
moondream_image = modal.Image.micromamba( | |
python_version="3.11" | |
).apt_install( | |
"git" | |
).micromamba_install( | |
"cudatoolkit", |
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
podman run --rm --device nvidia.com/gpu=all --security-opt=label=disable --mount type=bind,src="${PWD}",target=/workspace/axol | |
otl -v ${HOME}/.cache/huggingface:/root/.cache/huggingface winglian/axolotl:main-py3.10-cu118-2.0.1 accelerate launch -m axolotl.cli.train examples/openllam | |
a-3b/lora.yml |
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
#!/bin/bash | |
git clone https://github.com/continuedev/continue | |
npm config set prefix ~/.local | |
sh continue/install-dependencies.sh | |
cd continue/extensions/vscode | |
node scripts/prepackage.js | |
npm install @vscode/vsce | |
PATH=$PATH:~/.local/bin/ | |
npm install yarn | |
node scripts/package.js |
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 | |
print("pytorch version: " + torch.__version__) | |
print("CUDA available: " + str(torch.cuda.is_available())) | |
print("device count: " + str(torch.cuda.device_count())) | |
print("current device: " + str(torch.cuda.current_device())) | |
print("device name: " + torch.cuda.get_device_name(torch.cuda.current_device())) | |
print("backend:") | |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
print(device) |
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 requests | |
import collections | |
class BearerAuth(requests.auth.AuthBase): | |
def __init__(self, token): | |
self.token = token | |
def __call__(self, r): | |
r.headers['Authorization'] = 'Bearer ' + self.token | |
return r |
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
def upload_dataset_from_catalog(self, dataset): | |
import json | |
import time | |
# client = dr.Client() | |
res = client.post(client.endpoint + "/projects/{}/predictionDatasets/datasetUploads/".format(self.id), json={"datasetId": dataset.id}) | |
dataset_id = json.loads(res.text)['datasetId'] | |
while dataset_id not in [ds.id for ds in self.get_datasets()]: | |
time.sleep(1) | |
return dataset_id | |
def get_prediction_explanations(self, dataset_id): |
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
def upload_dataset_from_catalog(self, dataset): | |
import json | |
import time | |
client = dr.Client() | |
res = client.post(client.endpoint + "/projects/{}/predictionDatasets/datasetUploads/".format(self.id), json={"datasetId": dataset.id}) | |
dataset_id = json.loads(res.text)['datasetId'] | |
while dataset_id not in [ds.id for ds in self.get_datasets()]: | |
time.sleep(1) | |
return dataset_id | |
dr.Project.upload_dataset_from_catalog = upload_dataset_from_catalog |
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
Verifying that +sroecker is my openname (Bitcoin username). https://onename.io/sroecker |
NewerOlder