Skip to content

Instantly share code, notes, and snippets.

@fancyerii
fancyerii / transfer_learning_tutorial.py
Created April 22, 2024 02:41
Transfer Learning for Computer Vision Tutorial
# -*- coding: utf-8 -*-
"""
Transfer Learning for Computer Vision Tutorial
==============================================
**Author**: `Sasank Chilamkurthy <https://chsasank.github.io>`_
In this tutorial, you will learn how to train a convolutional neural network for
image classification using transfer learning. You can read more about the transfer
learning at `cs231n notes <https://cs231n.github.io/transfer-learning/>`__
@fancyerii
fancyerii / qs.py
Created April 22, 2024 01:34
test dcu
"""
`Learn the Basics <intro.html>`_ ||
**Quickstart** ||
`Tensors <tensorqs_tutorial.html>`_ ||
`Datasets & DataLoaders <data_tutorial.html>`_ ||
`Transforms <transforms_tutorial.html>`_ ||
`Build Model <buildmodel_tutorial.html>`_ ||
`Autograd <autogradqs_tutorial.html>`_ ||
`Optimization <optimization_tutorial.html>`_ ||
`Save & Load Model <saveloadrun_tutorial.html>`_
from transformers import AutoTokenizer, AutoModelForCausalLM
import os
import random
import numpy as np
import torch
def set_all_seeds(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
@fancyerii
fancyerii / make
Created November 16, 2023 04:42
make output
Making all in config
make[1]: Entering directory '/home/lili/openmpi-5.0.0/config'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/lili/openmpi-5.0.0/config'
Making all in contrib
make[1]: Entering directory '/home/lili/openmpi-5.0.0/contrib'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/lili/openmpi-5.0.0/contrib'
Making all in 3rd-party
make[1]: Entering directory '/home/lili/openmpi-5.0.0/3rd-party'
@fancyerii
fancyerii / pmix_info
Created November 16, 2023 04:41
pmix_info
$ pmix_info
Package: PMIx [email protected] Distribution
PMIX: 4.2.7a1
PMIX repo revision: v4.2.7
PMIX release date: Unreleased developer copy
PMIX Standard: 4.2
PMIX Standard ABI: Stable (0.0), Provisional (0.0)
Prefix: /usr/local
Configured architecture: pmix.arch
Configure host: u-gpu-a100-01.ai.test.ten
============================================================================
== Configuring Open MPI
============================================================================
*** Prerequisites
checking for a sed that does not truncate output... /usr/bin/sed
checking for perl... perl
*** Startup tests
diff --git a/src/llama_recipes/configs/datasets.py b/src/llama_recipes/configs/datasets.py
index 62230e4..3e4c76f 100644
--- a/src/llama_recipes/configs/datasets.py
+++ b/src/llama_recipes/configs/datasets.py
@@ -15,8 +15,8 @@ class samsum_dataset:
@dataclass
class grammar_dataset:
dataset: str = "grammar_dataset"
- train_split: str = "src/llama_recipes/datasets/grammar_dataset/gtrain_10k.csv"
- test_split: str = "src/llama_recipes/datasets/grammar_dataset/grammar_validation.csv"
import tensorflow as tf
from tensor2tensor import models
from tensor2tensor import problems
from tensor2tensor.utils import trainer_lib
from tensor2tensor.utils import t2t_model
from tensor2tensor.utils import registry
from tensor2tensor.utils.trainer_lib import create_hparams
import os
import numpy as np
import os
import sys
import numpy as np
import collections
import matplotlib.pyplot as plt# Colab-only TensorFlow version selector
import tensorflow as tf
from tensor2tensor import models
from tensor2tensor import problems
from tensor2tensor.layers import common_layers
from tensor2tensor.utils import trainer_lib
diff --git a/infer.py b/infer.py
index 3f31004..ec15d47 100644
--- a/infer.py
+++ b/infer.py
@@ -63,7 +63,8 @@ def infer(args):
dev_count = 1
gpu_id = 0
phase = "test"
- place = fluid.CUDAPlace(gpu_id)
+ #place = fluid.CUDAPlace(gpu_id)