More Gemini Features Coming to Google TV
Google TV integrates Gemini AI for image/video generation, enhances Google Photos, and adds a dedicated YouTube Shorts feed to the homepage.
Read more大型语言模型(LLM)已经成为革新工作方式的关键工具。众多企业与个人已开始依赖这些模型,这得益于活跃的社区和开源方法的发展。
当前开源实现的一个挑战在于缺乏能与单语言模型相匹敌的高性能多语言模型。为了解决这个问题,CohereAI的一个专业团队致力于开发能在多种语言中表现出色的模型,名为Aya Expanse。
本文将探讨CohereAI的Aya Expanse及其在实际工作中的应用。
Aya Expanse系列是CohereAI研发的多语言模型C4AI。该系列模型经过多年研究开发,旨在创建一个能够在23种不同语言中表现优异,并且能够与现有最先进模型竞争的模型。
目前发布的Aya Expanse模型包括8B和32B参数版本。这两种模型都展示了卓越的多语言性能,其中32B参数版本提供了最先进的能力。
Cohere团队还发布了Aya Expanse训练数据集——Aya集合及其关键评估集(涵盖多语言性能和安全性),供社区使用。这些数据集可以作为您训练多语言模型的参考。
让我们看看Aya Expanse与其他模型在市场上表现的对比。Aya Expanse 32B在m-ArenaHard评估集中具有更好的胜率指标,如下图所示。
Aya Expanse 32B总体上在23种语言中显示出更高的胜率,超过了Gemma 2 27B、Mistral 8x22B和Llama 3.1 70B等顶尖模型。这表明Aya Expanse可以成为解决任何涉及多语言问题业务案例的理想选择。
以上是对Aya Expanse的简要介绍。接下来,我们将尝试Aya Expanse模型,了解它们为何在处理多语言用例方面表现突出。
我们将通过HuggingFace空间和Transformers库来尝试Aya Expanse提供的功能。
如果您只想测试模型而不需要编写Python代码,可以访问Aya Expanse HuggingFace空间。这是一个基于UI的空间,允许用户与模型进行聊天、对话或可视化操作。
例如,我们可以探索不同语言下的聊天功能。
此外,您还可以通过语音输入与Aya Expanse互动,并获取结果。
最后,在HuggingFace空间内生成图像也是可行的。
我们为每个尝试的功能使用了三种不同的语言,展示了Aya Expanse在理解多种语言方面的强大能力,无需特定的再训练。
现在让我们尝试使用Python实现Aya Expanse。
pip install transformers huggingface_hub我们将使用标准的HuggingFace Transformers库进行教程,并从HuggingFace访问模型。请确保安装了必要的库并获得了API密钥。
from huggingface_hub import login
login('hf_api_key')登录后,下载Aya Expanse模型和分词器:
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "CohereForAI/aya-expanse-8b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)接下来,定义一个函数以快速生成文本:
def generate_text(messages):
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
gen_tokens = model.generate(
input_ids,
max_new_tokens=100,
do_sample=True,
temperature=0.3,
)
gen_text = tokenizer.decode(gen_tokens[0])
print(gen_text)使用上述函数,尝试让Aya Expanse模型用土耳其语创作故事:
#Creative Writing
messages = [{"role": "user", "content": "Bir yaz gecesi yıldızlar altında geçen bir aşk hikayesi yaz"}]
generate_text(messages)输出示例显示模型能够很好地理解提示并生成预期的内容。
接下来,尝试
Google TV integrates Gemini AI for image/video generation, enhances Google Photos, and adds a dedicated YouTube Shorts feed to the homepage.
Read moreAlphabet Q1 paid subscribers reached 350M, fueled by YouTube & Google One. YouTube ad revenue slightly missed at $9.88B amid Premium growth. Total Q1 revenue hit $109.9B, beating forecasts.
Read moreAnthropic releases Claude connectors for Adobe, Blender, and Ableton, enabling AI workflow automation and app control. It also sponsors the Blender Development Foundation.
Read moreApple introduces an App Store model splitting 12-month plans into monthly installments. On iOS 26.4+, it lowers upfront costs without reducing total price, adding billing tracking.
Read moreGoogle launches Aadhaar digital IDs in Wallet for India, enabling secure QR/NFC verification. A phased partner rollout targets key sectors, while passport-based credentials expand globally.
Read moreYouTube tests "Ask YouTube," an AI tool blending text and video for complex queries. Initially for US Premium users, it supports interactive follow-ups, expanding Google's AI search.
Read moreGoogle grants US DoD classified AI access, joining OpenAI and xAI in defense deals amid Anthropic's dispute. Contractual safeguards against surveillance and lethal weapons remain unenforceable.
Read moreMistral AI launches Workflows, a Temporal-powered orchestration platform for secure, Python-driven enterprise AI automation featuring human-in-the-loop approvals.
Read moreCustom subliminal audio maker

AI Social Media Manager

AI Search Visibility

Workout and Calorie Tracker
Stock research platform

AI interview assistant

Scientific figure generator

AI courses with real code