今天,我们将一起带小朋友们一起探索一个神奇的项目,就像读一个儿童故事一样。这个故事是一个科学家,用一天的时间,就像一天中的一个小冒险,创造了一个叫做 "婴儿 Llama2" 的小绵羊。现在,我们将快速地体验一下他的成果,看看这个 "llama2.c" 到底是什么样子。
首先,我们需要去一个特殊的地方,就像是一个藏宝图上的坐标,这个地方是存放项目的文件夹。我们可以使用一个魔法指令,就像是在地图上划出一条路线一样:
git clone https://github.com/karpathy/llama2.c.git
然后,就像是进入一个神秘的森林,我们进入这个文件夹:
cd llama2.c
接下来,就像是在准备一个魔法咒语一样,我们需要编译项目,让它变得有力量。我们可以这样做:
make run
现在,我们需要一些特殊的宝物,它们被称为 "参数模型"。这些宝物会帮助 "婴儿llama2" 创造出美妙的故事。我们有三种大小的宝物可供选择:15M、42M 和 110M。你可以想象它们就像是不同大小的魔法石,它们会影响故事的流畅程度和速度。你可以根据自己的心情选择一个宝物,比如说:
15M 宝物(15M参数模型):
wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin
42M 宝物(42M参数模型):
wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories42M.bin
110M 宝物(110M参数模型):
wget https://huggingface.co/karpathy/tinyllamas/resolve/main/stories110M.bin
好了,现在我们准备好了一切。就像是打开宝盒一样,我们选择最大的宝物,打开看看它能为我们创造什么奇幻的故事:
./run stories110M.bin
Once upon a time, there was a little girl named Lily. She loved to play outside in the sunshine. One day, she saw a bright butterfly flying around.
"Wow, look at that pretty butterfly!" she said to her mommy.
"Yes, it's very bright," her mommy replied.
Lily wanted to catch the butterfly, so she ran after it. But when she caught it, she accidentally pinched its wings.
"Oh no, I hurt the butterfly!" Lily cried.
"It's okay, we can still watch it," her mommy said, gently placing the butterfly on a nearby plant.
Lily was sad that she hurt the butterfly, but she learned to be more careful around bugs.
achieved tok/s: 3.636664
翻译:从前,有一个叫莉莉的小女孩。她喜欢在外面的阳光下玩耍。有一天,她看到一只明亮的蝴蝶飞来飞去。“哇,看看那只漂亮的蝴蝶!”她对妈妈说。“是的,非常明亮,”她的妈妈回答。莉莉想抓住那只蝴蝶,于是她追了上去。但当她抓住它时,不小心夹住了它的翅膀。“哦,不,我伤了蝴蝶!”莉莉喊道。“没关系,我们仍然可以看着它,”她的妈妈说,轻轻地把蝴蝶放在附近的植物上。莉莉很伤心她伤了蝴蝶,但她学会了在虫子面前更加小心。
或者我们给这个宝盒里的宝物加一个提示:
./run stories110M.bin -t 0.8 -n 256 -i "One morning, I walked on the street facing the sunshine"
One morning, I walked on the street facing the sunshine. I looked up and saw a big white cloud in the sky. I smiled and waved at it.
Suddenly, I heard a voice calling me. It was my friend, Max. Max was walking with his mom and I said hello.
Max and his mom stopped and asked me where I was. I said I was walking on the street, enjoying the sunshine.
Max and his mom laughed and said, 'That's great. It's a nice day for a walk!'
We kept walking until the sun started to set. Max said goodbye and my mom waved him off. I said goodbye too and waved until Max and his mom were out of sight.
I was happy to have said hello to the white cloud and the sunshine. It had been a fun morning!
achieved tok/s: 3.637573
翻译: 一天早上,我顶着阳光走在街上。我抬头一看,天空中有一大片白云。我微笑着向它挥手。 突然,我听到一个声音在叫我。是我的朋友马克斯。马克斯和他妈妈一起散步,我打招呼。 马克斯和他妈妈停下来问我在哪里。我说我走在街上,享受着阳光。 马克斯和妈妈笑着说:“太好了。今天是散步的好日子!” 我们一直走到太阳开始落山。马克斯说再见,我妈妈挥手让他离开。我也说再见,挥手直到马克斯和他妈妈不见了。 我很高兴向白云和阳光问好。这是一个有趣的早晨!
在这个魔法的运行中,你会看到一个故事开始逐渐展开,就像是一片梦幻的世界。你可以看到关于勇敢的冒险、美丽的风景,以及许许多多的惊喜。
这就是今天的小冒险,通过一个科学家的魔法创造,我们一起体验了 "llama2" 带来的奇妙世界。如果你愿意,你还可以尝试一些魔法咒语,让故事按照你的想法发展。记住,每个故事都有无限的可能,就像是星空中闪烁的星星一样。