Skip to content

Latest commit

 

History

History
84 lines (58 loc) · 3.74 KB

README.md

File metadata and controls

84 lines (58 loc) · 3.74 KB

TinyLlama 1.1B

📖 Introduction

TinyLlama project aims to pretrain a 1.1B Llama model on 3 trillion tokens. It adopted exactly the same architecture and tokenizer as Llama 2. This means TinyLlama can be plugged and played in many open-source projects built upon Llama. Besides, TinyLlama is compact with only 1.1B parameters. This compactness allows it to cater to a multitude of applications demanding a restricted computation and memory footprint.

Task Type Description
Chat A task to generate conversational style text output base on single or multi-modality input.

🔄 Compatibility Matrix

To ensure smooth integration, please refer to the compatibility matrix below. It outlines the compatible versions of the model, instill-core, and the python-sdk.

Model Version Instill-Core Version Python-SDK Version
v0.1.0 >v0.39.0-beta >0.11.0

Note: Always ensure that you are using compatible versions to avoid unexpected issues.

🚀 Preparation

Follow this guide to get your custom model up and running! But before you do that, please read through the following sections to have all the necessary files ready.

Install Python SDK

Install the compatible python-sdk version according to the compatibility matrix:

pip install instill-sdk=={version}

Get model weights

To download the fine-tuned model weights, please execute the following command:

git clone https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0 tinyllama

Test model image

After you've built the model image, and before pushing the model onto any Instill Core instance, you can test if the model can be successfully run locally first, by running the following command:

instill run instill-ai/tinyllama -g -i '{"prompt": "hows your day?"}'

The input payload should strictly follow the the below format

{
  "prompt": "..."
}

A successful response will return a similar output to that shown below.

2024-09-11 02:11:24,279.279 INFO     [Instill] Starting model image...
2024-09-11 02:11:34,709.709 INFO     [Instill] Deploying model...
2024-09-11 02:11:59,822.822 INFO     [Instill] Running inference...
2024-09-11 02:12:03,578.578 INFO     [Instill] Outputs:
[{'data': {'choices': [{'created': 1725991923,
                        'finish-reason': 'length',
                        'index': 0,
                        'message': {'content': 'I don\'t have a personal '
                                               'experience, but I can tell you '
                                               'that your day sounds fine. '
                                               'Hope you are having a great '
                                               'time and doing well!',
                                    'role': 'assistant'}}]}}]
2024-09-11 02:12:07,153.153 INFO     [Instill] Done

Here is the list of flags supported by instill run command

  • -t, --tag: tag for the model image, default to latest
  • -g, --gpu: to pass through GPU from host into container or not, depends on if gpu is enabled in the config.
  • -i, --input: input in json format

Happy Modeling! 💡