Skip to content

Commit

Permalink
enh: enable CodeLlama (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreyangus authored Nov 21, 2023
1 parent 188834f commit 5b1bb93
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
25 changes: 8 additions & 17 deletions server/lorax_server/models/flash_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from loguru import logger
from opentelemetry import trace
from transformers.models.llama import LlamaTokenizer, LlamaTokenizerFast
from transformers import AutoTokenizer
from tqdm import tqdm
from typing import Dict, Optional

Expand Down Expand Up @@ -45,22 +45,13 @@ def __init__(
else:
raise NotImplementedError("FlashLlama is only available on GPU")

try:
tokenizer = LlamaTokenizer.from_pretrained(
model_id,
revision=revision,
padding_side="left",
truncation_side="left",
trust_remote_code=trust_remote_code,
)
except Exception:
tokenizer = LlamaTokenizerFast.from_pretrained(
model_id,
revision=revision,
padding_side="left",
truncation_side="left",
trust_remote_code=trust_remote_code,
)
tokenizer = AutoTokenizer.from_pretrained(
model_id,
revision=revision,
padding_side="left",
truncation_side="left",
trust_remote_code=trust_remote_code,
)

config = LlamaConfig.from_pretrained(
model_id, revision=revision, trust_remote_code=trust_remote_code
Expand Down
8 changes: 4 additions & 4 deletions server/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accelerate==0.19.0 ; python_version >= "3.9" and python_version < "4.0"
accelerate==0.24.1 ; python_version >= "3.9" and python_version < "4.0"
aiohttp==3.8.5 ; python_version >= "3.9" and python_version < "4.0"
aiosignal==1.3.1 ; python_version >= "3.9" and python_version < "4.0"
async-timeout==4.0.2 ; python_version >= "3.9" and python_version < "4.0"
Expand All @@ -23,7 +23,7 @@ grpcio-reflection==1.56.0 ; python_version >= "3.9" and python_version < "4.0"
grpcio-status==1.56.0 ; python_version >= "3.9" and python_version < "4.0"
grpcio==1.56.0 ; python_version >= "3.9" and python_version < "4.0"
hf-transfer==0.1.3 ; python_version >= "3.9" and python_version < "4.0"
huggingface-hub==0.14.1 ; python_version >= "3.9" and python_version < "4.0"
huggingface-hub==0.19.4 ; python_version >= "3.9" and python_version < "4.0"
idna==3.4 ; python_version >= "3.9" and python_version < "4.0"
jinja2==3.1.2 ; python_version >= "3.9" and python_version < "4.0"
loguru==0.6.0 ; python_version >= "3.9" and python_version < "4.0"
Expand Down Expand Up @@ -59,10 +59,10 @@ setuptools==68.0.0 ; python_version >= "3.9" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.9" and python_version < "4.0"
sympy==1.12 ; python_version >= "3.9" and python_version < "4.0"
texttable==1.6.7 ; python_version >= "3.9" and python_version < "4.0"
tokenizers==0.13.3 ; python_version >= "3.9" and python_version < "4.0"
tokenizers==0.15.0 ; python_version >= "3.9" and python_version < "4.0"
torch==2.0.1 ; python_version >= "3.9" and python_version < "4.0"
tqdm==4.65.0 ; python_version >= "3.9" and python_version < "4.0"
transformers==4.29.2 ; python_version >= "3.9" and python_version < "4.0"
transformers==4.35.2 ; python_version >= "3.9" and python_version < "4.0"
typer==0.6.1 ; python_version >= "3.9" and python_version < "4.0"
typing-extensions==4.7.1 ; python_version >= "3.9" and python_version < "4.0"
tzdata==2023.3 ; python_version >= "3.9" and python_version < "4.0"
Expand Down

0 comments on commit 5b1bb93

Please sign in to comment.