https://ai.meta.com/blog/meta-llama-3-1/https://ai.meta.com/blog/meta-llama-3-1/我测试了它写代码能力,让它用python写个贪吃蛇游戏,写代码速度很慢,但是一次成功,下面是它写的代码和,代码运行的效果。
import pygame import sys import random # Initialize Pygame pygame.init() # Set up some constants WIDTH, HEIGHT = 800, 600 BLOCK_SIZE = 20 SPEED = 10 # Set up some colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) # Set up the display screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Snake") # Set up the font font = pygame.font.Font(None, 36) # Set up the snake and food snake = [(200, 200), (220, 200), (240, 200)] food = (400, 300) # Set up the direction direction = "RIGHT" # Game loop while True: # Event handling for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() elif event.type == pygame.KEYDOWN: if event.key == pygame.K_UP and direction!= "DOWN": direction = "UP" elif event.key == pygame.K_DOWN and direction!= "UP": direction = "DOWN" elif event.key == pygame.K_LEFT and direction!= "RIGHT": direction = "LEFT" elif event.key == pygame.K_RIGHT and direction!= "LEFT": direction = "RIGHT" # Move the snake head = snake[-1] if direction == "UP": new_head = (head[0], head[1] - BLOCK_SIZE) elif direction == "DOWN": new_head = (head[0], head[1] + BLOCK_SIZE) elif direction == "LEFT": new_head = (head[0] - BLOCK_SIZE, head[1]) elif direction == "RIGHT": new_head = (head[0] + BLOCK_SIZE, head[1]) snake.append(new_head) # Check for collision with food if snake[-1] == food: food = (random.randint(0, WIDTH - BLOCK_SIZE) // BLOCK_SIZE * BLOCK_SIZE, random.randint(0, HEIGHT - BLOCK_SIZE) // BLOCK_SIZE * BLOCK_SIZE) else: snake.pop(0) # Check for collision with self or wall if (snake[-1] in snake[:-1] or snake[-1][0] < 0 or snake[-1][0] >= WIDTH or snake[-1][1] < 0 or snake[-1][1] >= HEIGHT): pygame.quit() sys.exit() # Draw everything screen.fill(BLACK) for pos in snake: pygame.draw.rect(screen, GREEN, (pos[0], pos[1], BLOCK_SIZE, BLOCK_SIZE)) pygame.draw.rect(screen, RED, (food[0], food[1], BLOCK_SIZE, BLOCK_SIZE)) text = font.render(f"Score: {len(snake)}", True, WHITE) screen.blit(text, (10, 10)) pygame.display.flip() # Cap the frame rate pygame.time.delay(1000 // SPEED)
Context Window扩展:Llama 3.1将模型的Context Window从原来的8K tokens扩展到了128K tokens,极大地提升了处理长文和长对话的能力。
模型架构:Llama 3.1沿用了Llama 3的基础架构,即使是405B参数的模型也采用标准的decoder-only transformer架构,而非混合专家模型。同时继续使用GQA(分组查询注意力)技术,提高了长文处理能力。
性能表现:
许可证更新:Meta更新了Llama 3.1的许可条款,允许使用模型输出来改进其他语言模型,但要求训练出的新模型名称必须以"Llama"开头,并标注"Built with Llama"。
指令微调:Llama 3.1的Instruct版本根据工具调用进行了微调,并引入了新的iPython角色来接收和记录工具调用返回的数据。
HuggingChat:
Groq:
推荐使用LM Studio程序:LM Studio - Discover, download, and run local LLMsLM Studio is an easy to use desktop app for experimenting with local and open-source Large Language Models (LLMs). The LM Studio cross platform desktop app allows you to download and run any ggml-compatible model from Hugging Face, and provides a simple yet powerful model configuration and inferencing UI. The app leverages your GPU when possible.https://lmstudio.ai/
Llama 3.1的发布无疑是开源语言模型发展的一个重要里程碑。405B参数模型与顶级商业闭源模型的竞争力,以及8B参数模型超越Google Gemma 2 9B的表现,都展示了开源社区的巨大潜力。Meta允许将Llama 3.1用于知识蒸馏,这一决定将进一步推动开源AI社区的蓬勃发展。
让我们一起期待AI技术的持续进步,为更开放、更强大的语言模型贡献力量。
如果您喜欢这篇文章,欢迎点赞订阅我的频道。下期再见,各位兄弟朋友们请多保重!
下一篇:uc浏览器怎么免费解压