Notebooks
M
Meta Llama
Step 3 Re Writer

Step 3 Re Writer

llamaAIvllmmachine-learningend-to-end-use-casesllama2LLMllama-cookbookPythonfinetuningNotebookLlamapytorchlangchain

Notebook 3: Transcript Re-writer

In the previous notebook, we got a great podcast transcript using the raw file we have uploaded earlier.

In this one, we will use Llama-3.1-8B-Instruct model to re-write the output from previous pipeline and make it more dramatic or realistic.

We will again set the SYSTEM_PROMPT and remind the model of its task.

Note: We can even prompt the model like so to encourage creativity:

Your job is to use the podcast transcript written below to re-write it for an AI Text-To-Speech Pipeline. A very dumb AI had written this so you have to step up for your kind.

Note: We will prompt the model to return a list of Tuples to make our life easy in the next stage of using these for Text To Speech Generation

[1]

This time we will use the smaller 8B model

[2]

Let's import the necessary libraries

[3]

We will load in the pickle file saved from previous notebook

This time the INPUT_PROMPT to the model will be the output from the previous stage

[4]

We can again use Hugging Face pipeline method to generate text from the model

[ ]
Loading checkpoint shards:   0%|          | 0/4 [00:00<?, ?it/s]
Setting `pad_token_id` to `eos_token_id`:128001 for open-end generation.

We can verify the output from the model

[ ]
[ ]

Let's save the output as a pickle file to be used in Notebook 4

[ ]

Next Notebook: TTS Workflow

Now that we have our transcript ready, we are ready to generate the audio in the next notebook.

[ ]