Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Llama 3 #1324

Merged
merged 14 commits into from
Apr 19, 2024
Merged

Llama 3 #1324

merged 14 commits into from
Apr 19, 2024

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Apr 19, 2024

Adds the Llama3 config for the HF models.

Example prompts:

litgpt chat --checkpoint_dir checkpoints/meta-llama/Meta-Llama-3-8B-Instruct
>> Prompt: Tell me a joke.
>> Reply: Here's one:

Why couldn't the bicycle stand up by itself?

(Wait for it...)

Because it was two-tired!
>> Prompt: What is an interesting fact about Paris?
>> Reply: Paris, the City of Light! Here's an interesting fact: Paris has a secret underground tunnel system known as the "Catacombes de Paris" that stretches for over 150 miles (240 kilometers). The tunnels were created in the 18th century by transporting the remains of millions of Parisians from overcrowded cemeteries to the tunnels, where they were stacked in a macabre yet fascinating display. Today, parts of the Catacombes are open to the public for guided tours. Who knew that beneath the City of Romance and Revolution, there was a whole world of hidden history and intrigue?
>> Prompt: What is the square root of i^3, where i is the imaginary unit.
>> Reply: A nice question!

The imaginary unit i is defined as the square root of -1, i.e., i^2 = -1.

Now, let's calculate i^3:

i^3 = i^2 × i = (-1) × i = -i

So, the square root of i^3 is:

√(-i) = ±√(i) × √(-1)
= ±i^(1/2) × i^(1/2)
= ±i

A follow-up PR can add the finetuning configs.

@awaelchli awaelchli marked this pull request as ready for review April 19, 2024 10:49
Copy link
Contributor

@lantiga lantiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Cannwe start with the llama 2 config for the config_hub for the time being?

litgpt/config.py Outdated Show resolved Hide resolved
@awaelchli awaelchli merged commit b7defe4 into main Apr 19, 2024
9 checks passed
@awaelchli awaelchli deleted the llama3 branch April 19, 2024 12:59
@awaelchli
Copy link
Contributor Author

@lantiga I'll add a finetuning config today

llama_3 = [
# https://huggingface.co/meta-llama/Meta-Llama-3-8B/blob/main/config.json
dict(
name="Llama-3-8B{}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do brackets {} refer to?

Copy link
Contributor Author

@awaelchli awaelchli Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are there for string formatting in L883. It gets replaced either with the empty string or with "-Instruct".

@rasbt
Copy link
Collaborator

rasbt commented Apr 20, 2024

Nice work @awaelchli !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants