Lexa
commited on
Commit
·
bb10ea5
1
Parent(s):
f161f04
readme
Browse files
README.md
CHANGED
|
@@ -15,7 +15,11 @@ A pre-trained LCM model with 288M parameters based on Meta FAIR's LCM architectu
|
|
| 15 |
|
| 16 |
Note: These instructions are for running the model on a single machine with a single GPU. If your system does not have a GPU that supports at least CUDA 12.1, or if you intend to execute this in the cloud, you'll need to modify the code per your requirements.
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
```bash
|
| 20 |
sudo apt update
|
| 21 |
sudo apt install libmkl-rt
|
|
@@ -23,17 +27,55 @@ export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH
|
|
| 23 |
source ~/.bashrc
|
| 24 |
```
|
| 25 |
|
| 26 |
-
|
| 27 |
```bash
|
| 28 |
uv sync --extra gpu --extra eval --extra data
|
| 29 |
```
|
| 30 |
|
| 31 |
-
|
| 32 |
These two model cards' paths must be updated to use the current paths based on where they exist in your local filesystem.
|
| 33 |
* '_LexaLCM_Pre0/Checkpoints/LCM_TwoTower_Pre0/model_card.yaml'
|
| 34 |
* '_LexaLCM_Pre0/Checkpoints/LCM_TwoTower_Pre0/checkpoints/step_250000/model_card.yaml'
|
| 35 |
|
| 36 |
-
|
| 37 |
```bash
|
| 38 |
uv run --extra gpu scripts/run_inference.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
```
|
|
|
|
| 15 |
|
| 16 |
Note: These instructions are for running the model on a single machine with a single GPU. If your system does not have a GPU that supports at least CUDA 12.1, or if you intend to execute this in the cloud, you'll need to modify the code per your requirements.
|
| 17 |
|
| 18 |
+
This model currently is a small proof-of-concept model, and is not yet ready for production use. Its output is not usable for any real-world application, but it serves to demonstrate the capabilities of the LCM architecture as, even though it is a very small model with 288M parameters and only 250k training steps, it is already able to demostrate that it is able to stay roughly within the same conceptual space as the given prompt.
|
| 19 |
+
|
| 20 |
+
## Installation and Usage
|
| 21 |
+
|
| 22 |
+
### 1. Install the Intel MKL runtime
|
| 23 |
```bash
|
| 24 |
sudo apt update
|
| 25 |
sudo apt install libmkl-rt
|
|
|
|
| 27 |
source ~/.bashrc
|
| 28 |
```
|
| 29 |
|
| 30 |
+
### 2. Install dependencies
|
| 31 |
```bash
|
| 32 |
uv sync --extra gpu --extra eval --extra data
|
| 33 |
```
|
| 34 |
|
| 35 |
+
### 3. Update the model cards' paths
|
| 36 |
These two model cards' paths must be updated to use the current paths based on where they exist in your local filesystem.
|
| 37 |
* '_LexaLCM_Pre0/Checkpoints/LCM_TwoTower_Pre0/model_card.yaml'
|
| 38 |
* '_LexaLCM_Pre0/Checkpoints/LCM_TwoTower_Pre0/checkpoints/step_250000/model_card.yaml'
|
| 39 |
|
| 40 |
+
### 4. Test the model's inference
|
| 41 |
```bash
|
| 42 |
uv run --extra gpu scripts/run_inference.py
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
## Output
|
| 46 |
+
|
| 47 |
+
If all goes well, you should see an output like the following:
|
| 48 |
+
|
| 49 |
+
```
|
| 50 |
+
Processing prompts:
|
| 51 |
+
|
| 52 |
+
Prompt 1:
|
| 53 |
+
Petals fall in the wind.
|
| 54 |
+
They swirl and dance and float away.
|
| 55 |
+
Then all becomes still again.
|
| 56 |
+
Sentence embeddings shape: torch.Size([3, 1024])
|
| 57 |
+
|
| 58 |
+
Prompt 2:
|
| 59 |
+
Like whisps of light, the moonlight meets the rolling brook.
|
| 60 |
+
Upon seeing it glimmer, she turns and smiles.
|
| 61 |
+
Her friend was glad they could share this tranquil moment.
|
| 62 |
+
Sentence embeddings shape: torch.Size([3, 1024])
|
| 63 |
+
|
| 64 |
+
Prompt 3:
|
| 65 |
+
Tokyo is the modern capital of Japan.
|
| 66 |
+
Although it is currently the case, historically, cities such as Kyoto and Nara have also served as the capital.
|
| 67 |
+
Sentence embeddings shape: torch.Size([2, 1024])
|
| 68 |
+
|
| 69 |
+
Final batch shape: torch.Size([3, 3, 1024])
|
| 70 |
+
|
| 71 |
+
Generated outputs:
|
| 72 |
+
|
| 73 |
+
Output for Prompt 1:
|
| 74 |
+
Generated text: ['Petals fall in the wind.', 'They whirl and dance and float away.', 'Then everything becomes still again.', 'When winds will wave and shine', '♪ Winds are waving come on ♪', 'Wander will we dance', 'Waves and waves and waves and waves', '♪ Winds dance and winds dance and winds dance', '♪ Winds and waves and winds and waves ♪', '♪ We winds dance ♪ ♪ The winds dance ♪', '♪ Rain will flow ♪ ♪ Rain will sing ♪', '♪ Waves will flow and waves will flow ♪', 'Winds dance and winds dance and winds', '♪Winds flow and winds dance ♪', '♪ Winds will flow and winds will blow', '♪ Rain will sing ♪ ♪ Rain will sing ♪', '♪ Winds and waves ♪ ♪ Winds and waves', '♪ Winds dance ♪ ♪ Winds dance ♪ ♪ Winds dance', '♪ Wave the winds ♪ ♪ Wave the winds ♪', '♪ Winds the winds the winds the winds ♪', '♪ Rain will flow ♪ ♪ Rain will flow ♪ ♪ Rain will flow ♪', '♪ Songs will flow ♪ ♪ Music will flow ♪', '♪ Rain will sing ♪ ♪ Rain will sing ♪', '♪ Rain waters dance ♪ ♪ Rain waters dance ♪', '♪ Rain will flow ♪ ♪ Rain will flow ♪', '♪ Winds and winds and winds ♪', '♪ Winds and winds and winds and winds ♪']
|
| 75 |
+
|
| 76 |
+
Output for Prompt 2:
|
| 77 |
+
Generated text: ['Like whispers of light, moonlight meets the rolling brook.', 'When she sees it glowing, she turns and smiles.', 'Her friend was happy that they could share this peaceful moment.', 'The girl wails the going, and screams away and smiles.', 'She sends the lightning to the back, and it sees me.', 'The light flashes, light sees, and the light shines.', 'Her sight glows, she sees a light.', 'Lightlight, the light shines, light shines.', 'Lightning shine, light up the light.', 'Lightshine illuminates the light.', 'Lightshining light the light, light shining.', 'Lightning light the lightshining Lightning .', 'Lightener Light Light Light Light Light Light light is lighted', 'Lighthouse lightlight illuminates light.', 'Lightning lights the lightlight Lightning light to light', 'Lightning lights Lightlight light light light, light', 'Lightshine light light light light light', 'Lightlighting lighthouse lighting light, light', 'Lighthouse lightlight Lightlight the light.', 'Lightning lighter the lightlight Lightning light', 'Lightning light light light light is light.', 'Lightlighting light light light, light', 'Lightshining light Lightlight, lighting light', 'Lighthouse light lightlight Lightlight.', 'Lightlighter light Light light light light light', 'Lighthouse light light light light light light light', 'Lighthouse light light light light light light']
|
| 78 |
+
|
| 79 |
+
Output for Prompt 3:
|
| 80 |
+
Generated text: ['Tokyo is the modern capital of Japan.', 'Although it is currently the case, historically, cities such as Kyoto and Nara have also served as the capital.', "In the meantime, I'm going to take a look at some of the things that I've done in the past, and I'm going to show you what I've done in the past.", 'History and', 'Overview', 'The town square is modern is considered.', 'Today it now exists to the present day.', 'In', "Tokyo Tokyo is the city capital of Tokyo, the date of the city's historic city, as the metropolitan Jōjitsu. Tokyo City has been established as the city's capital for many years.", 'Large-scale city center and city population in Japan is the city Tokyo is the first city in the world to host the city.', 'Tokyo, city capital and city-city of Tokyo, is the largest city in the world.', "Tokyo finds Tokyo city the largest city of city and city, and Tokyo city is the city's capital of the city.", "Tokyo, the city city of the city is the city's capital. Tokyo is the city's capital and the city's cultural capital.", 'Tokyo, city, city, city, city, city, city, city, city', 'Tokyo is the city capital of the world. Tokyo is the largest city in the world.', 'Tokyo, the city city of the city city of the city of the city of the city of the city of the city of the city of the city of the city of the city', 'City of Tokyo City of Tokyo is the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city of the city city of the city of the city', 'Tokyo, city city, is the largest city in the world.', 'City Tokyo is the largest city in the world, and the city of Tokyo is the largest city in the world.', 'City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo', 'City of Tokyo, the city city of the city of the city of the city of the city of the city of the city of the city of the city', 'Tokyo, City of City City, City of City City, City of City City, City of City City, City of City City, City of City, City of City, City of City, City of City, City of City City, City of City City, City of City City, City of City City, City of City City, City of City City, City of City City, City of City of City, City of City City, City of City City, City of City of City, City of City of City, City of City of City, City of City of City, City of City of City City of City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City City', 'City City City City City City City City is the largest city in the world.', 'City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo City of Tokyo', 'City City is the largest city in the world. City City is the largest city in the world.', 'City city city city city city city city city city city city city city city city city', 'City City City City City City City City City is the largest city in the world.']
|
| 81 |
```
|