-
Notifications
You must be signed in to change notification settings - Fork 832
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
V2D-1268 Use smaller model in demo and reference larger (#5119)
- Loading branch information
Showing
10 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
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
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
File renamed without changes.
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
File renamed without changes.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.env/ | ||
text-generation-model-artefacts/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
VERSION := $(shell cat ../../../../version.txt) | ||
|
||
all: env train upload | ||
|
||
model: env train | ||
|
||
env: | ||
python3 -m venv .env | ||
./.env/bin/pip install --upgrade pip setuptools | ||
./.env/bin/pip install -r requirements.txt | ||
|
||
train: | ||
.env/bin/python train.py | ||
|
||
upload: | ||
gsutil cp -r text-generation-model-artefacts/* gs://seldon-models/v${VERSION}/huggingface/text-gen-custom-tiny-stories/ |
3 changes: 3 additions & 0 deletions
3
servers/huggingface/models/text-gen-tiny-stories/requirements.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
seldon_core | ||
transformers >=4.30,<4.32 | ||
torch==2.0.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from transformers import ( | ||
AutoModelForCausalLM, | ||
AutoTokenizer, | ||
pipeline, | ||
) | ||
|
||
|
||
def main() -> None: | ||
tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-125M") | ||
model = AutoModelForCausalLM.from_pretrained('roneneldan/TinyStories-1M') | ||
|
||
p = pipeline(task="text-generation", model=model, tokenizer=tokenizer) | ||
|
||
p.save_pretrained("text-generation-model-artefacts") | ||
|
||
|
||
if __name__ == "__main__": | ||
print("Building a custom Tiny Stories HuggingFace model...") | ||
main() |