Text Generation
ELM
English
dev-slx's picture
Update README.md
3f338f6 verified
|
raw
history blame
2.57 kB
# SliceX AI™ ELM (Efficient Language Models)
This repository contains code to run our ELM models.
Models are located in the "models" folder. ELM models in this repository comes in three sizes (elm-1.0, elm-0.75 and elm-0.25) and supports the following use-case.
- news_content_generation
## Download ELM repo
```bash
git clone [email protected]:slicexai/elm-v0.1_news_content_generation
sudo apt-get intall git-lfs
git lfs install
```
(Optional) Installing git-lfs without sudo,
```bash
wget https://github.com/git-lfs/git-lfs/releases/download/v3.2.0/git-lfs-linux-amd64-v3.2.0.tar.gz
tar -xzf git-lfs-linux-amd64-v3.2.0.tar.gz
PATH=$PATH:/<absolute-path>/git-lfs-3.2.0/
git lfs install
```
## Download ELM model checkpoints
```bash
cd elm-v0.1_news_content_generation
git lfs pull -I models/elm-1.0_news_content_generation/ckpt.pt
git lfs pull -I models/elm-0.75_news_content_generation/ckpt.pt
git lfs pull -I models/elm-0.25_news_content_generation/ckpt.pt
```
## Installation
```bash
pip install -r requirements.txt
```
## How to use - Run ELM on a sample task (e.g., news classification)
```bash
python run.py <elm-model-directory>
E.g. python run.py models/elm-0.75_news_content_generation
```
Prompts for the specific tasks can be found in the corresponding checkpoint directory. See an example below in the form of `models/elm-0.75_news_content_generation/example_prompts.json`.
```json
{
"inputs": ["Scientists Invent 'Invisible' Metamaterial With Bonus Reflect Mode"],
"template": "[INST]The following headline is the headline of a news report. Please write the content of the news passage based on only this headline.\n\nHeadline: {input} \n\nContent:[/INST]"
}
```
Running the above command returns the following response
```json
{
"prompt": "[INST]The following headline is the headline of a news report. Please write the content of the news passage based on only this headline.\n\nHeadline: Scientists Invent 'Invisible' Metamaterial With Bonus Reflect Mode \n\nContent:[/INST]",
"response": "A team of scientists have created an invisible material that can make objects disappear. It is made of a special material that creates a layer of nanoscale dots that allow light to enter from the material, directing it to a layer of gas that allows light to enter from the material. The material is able to levitate and roll off its surface without leaving the material. This technology could have many future applications in battery technology, microelectronics, and more. A video demonstrating the material is available in the article."
}
```