Skip to content

Commit

Permalink
docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Feb 2, 2024
1 parent 9891f5d commit ae5c3bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/models/llama/test_inference_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@

device = "cuda"

assert os.getenv("HF_HUB_READ_TOKEN", None) != None



class LLaMaInferenceTest(unittest.TestCase):

def test_foo(self):
ckpt = "meta-llama/Llama-2-7b"
assert os.getenv("HF_HUB_READ_TOKEN", None) != None
assert type(os.getenv("HF_HUB_READ_TOKEN", None)) == str
assert len(os.getenv("HF_HUB_READ_TOKEN", None)) > 3
model = AutoModelForCausalLM.from_pretrained(ckpt, token=os.getenv("HF_HUB_READ_TOKEN", None))
model.to(device)
4 changes: 4 additions & 0 deletions tests/models/llama/test_train_llama.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import unittest

from transformers import AutoModelForCausalLM
Expand All @@ -9,6 +10,9 @@ class LLaMaTrainingTest(unittest.TestCase):

def test_foo(self):
ckpt = "meta-llama/Llama-2-7b"
assert os.getenv("HF_HUB_READ_TOKEN", None) != None
assert type(os.getenv("HF_HUB_READ_TOKEN", None)) == str
assert len(os.getenv("HF_HUB_READ_TOKEN", None)) > 3
model = AutoModelForCausalLM.from_pretrained(ckpt, token=os.getenv("HF_HUB_READ_TOKEN", None))
model.train()
model.to(device)

0 comments on commit ae5c3bd

Please sign in to comment.