Gemma Portuguese Luana 2b
これはGemmaアーキテクチャに基づく20億パラメータ規模のポルトガル語大規模言語モデルで、特にブラジルポルトガル語に最適化されており、指令追従とテキスト生成タスクをサポートします。
ダウンロード数 115
リリース時間 : 3/25/2024
モデル概要
このモデルはポルトガル語(特にブラジルポルトガル語)に最適化された指令追従型大規模言語モデルで、Gemmaアーキテクチャを用いて開発され、様々なテキスト生成・理解タスクに適しています。
モデル特徴
ポルトガル語最適化
ブラジルポルトガル語向けに特別に訓練・最適化されており、より自然な言語処理能力を提供します
指令追従
複雑な自然言語指令を理解し実行できます
マルチタスク処理
様々なテキスト生成・理解タスクをサポートします
モデル能力
テキスト生成
指令理解
質問応答システム
コンテンツ作成
テキスト要約
使用事例
教育
ENEM試験支援
ブラジル国家中等教育試験(ENEM)の準備を学生支援
ENEMチャレンジデータセットで24.42%の精度を達成
法律
OAB弁護士試験支援
ブラジル弁護士資格試験の準備を支援
OAB試験データセットで27.11%の精度を達成
コンテンツモデレーション
ヘイトスピーチ検出
ポルトガル語のヘイトスピーチを識別
HateBRデータセットで40.05%のマクロF1スコアを達成
language:
- pt license: apache-2.0 library_name: transformers tags:
- portuguese
- brasil
- gemma
- portugues
- instrucao datasets:
- rhaymison/superset pipeline_tag: text-generation widget:
- text: Me explique como funciona um computador. example_title: Computador.
- text: Me conte sobre a ida do homem a Lua. example_title: Homem na Lua.
- text: Fale sobre uma curiosidade sobre a história do mundo example_title: História.
- text: Escreva um poema bem interessante sobre o Sol e as flores. example_title: Escreva um poema. model-index:
- name: gemma-portuguese-luana-2b
results:
- task:
type: text-generation
name: Text Generation
dataset:
name: ENEM Challenge (No Images)
type: eduagarcia/enem_challenge
split: train
args:
num_few_shot: 3
metrics:
- type: acc value: 24.42 name: accuracy source: url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=rhaymison/gemma-portuguese-luana-2b name: Open Portuguese LLM Leaderboard
- task:
type: text-generation
name: Text Generation
dataset:
name: BLUEX (No Images)
type: eduagarcia-temp/BLUEX_without_images
split: train
args:
num_few_shot: 3
metrics:
- type: acc value: 24.34 name: accuracy source: url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=rhaymison/gemma-portuguese-luana-2b name: Open Portuguese LLM Leaderboard
- task:
type: text-generation
name: Text Generation
dataset:
name: OAB Exams
type: eduagarcia/oab_exams
split: train
args:
num_few_shot: 3
metrics:
- type: acc value: 27.11 name: accuracy source: url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=rhaymison/gemma-portuguese-luana-2b name: Open Portuguese LLM Leaderboard
- task:
type: text-generation
name: Text Generation
dataset:
name: Assin2 RTE
type: assin2
split: test
args:
num_few_shot: 15
metrics:
- type: f1_macro value: 70.86 name: f1-macro source: url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=rhaymison/gemma-portuguese-luana-2b name: Open Portuguese LLM Leaderboard
- task:
type: text-generation
name: Text Generation
dataset:
name: Assin2 STS
type: eduagarcia/portuguese_benchmark
split: test
args:
num_few_shot: 15
metrics:
- type: pearson value: 1.51 name: pearson source: url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=rhaymison/gemma-portuguese-luana-2b name: Open Portuguese LLM Leaderboard
- task:
type: text-generation
name: Text Generation
dataset:
name: FaQuAD NLI
type: ruanchaves/faquad-nli
split: test
args:
num_few_shot: 15
metrics:
- type: f1_macro value: 43.97 name: f1-macro source: url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=rhaymison/gemma-portuguese-luana-2b name: Open Portuguese LLM Leaderboard
- task:
type: text-generation
name: Text Generation
dataset:
name: HateBR Binary
type: ruanchaves/hatebr
split: test
args:
num_few_shot: 25
metrics:
- type: f1_macro value: 40.05 name: f1-macro source: url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=rhaymison/gemma-portuguese-luana-2b name: Open Portuguese LLM Leaderboard
- task:
type: text-generation
name: Text Generation
dataset:
name: PT Hate Speech Binary
type: hate_speech_portuguese
split: test
args:
num_few_shot: 25
metrics:
- type: f1_macro value: 51.83 name: f1-macro source: url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=rhaymison/gemma-portuguese-luana-2b name: Open Portuguese LLM Leaderboard
- task:
type: text-generation
name: Text Generation
dataset:
name: tweetSentBR
type: eduagarcia/tweetsentbr_fewshot
split: test
args:
num_few_shot: 25
metrics:
- type: f1_macro value: 30.42 name: f1-macro source: url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=rhaymison/gemma-portuguese-luana-2b name: Open Portuguese LLM Leaderboard
- task:
type: text-generation
name: Text Generation
dataset:
name: ENEM Challenge (No Images)
type: eduagarcia/enem_challenge
split: train
args:
num_few_shot: 3
metrics:
gemma-portuguese-2b-luana
Model description
updated: 2024-04-10 20:06
The gemma-portuguese-2b model is a portuguese model trained with the superset dataset with 250,000 instructions. The model is mainly focused on text generation and instruction. The model was not trained on math and code tasks. The model is generalist with focus on understand portuguese inferences. With this fine tuning for portuguese, you can adjust the model for a specific field.
How to Use
from transformers import AutoTokenizer, pipeline
import torch
model = "rhaymison/gemma-portuguese-luana-2b"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = pipeline(
"text-generation",
model=model,
model_kwargs={"torch_dtype": torch.bfloat16},
device="cuda",
)
messages = [
{
"role": "system",
"content": "Abaixo está uma instrução que descreve uma tarefa, juntamente com uma entrada que fornece mais contexto. Escreva uma resposta que complete adequadamente o pedido."
},
{"role": "user", "content": "Me conte sobre a ida do homem a Lua."},
]
prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = pipeline(
prompt,
max_new_tokens=256,
do_sample=True,
temperature=0.2,
top_k=50,
top_p=0.95
)
print(outputs[0]["generated_text"][len(prompt):].replace("model",""))
#A viagem à Lua foi um esforço monumental realizado pela Agência Espacial dos EUA entre 1969 e 1972.
#Foi um marco significativo na exploração espacial e na ciência humana.
#Aqui está uma visão geral de sua jornada: 1. O primeiro voo espacial humano foi o de Yuri Gagarin, que voou a Terra em 12 de abril de 1961.
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer2 = AutoTokenizer.from_pretrained("rhaymison/gemma-portuguese-luana-2b")
model2 = AutoModelForCausalLM.from_pretrained("rhaymison/gemma-portuguese-luana-2b", device_map={"":0})
tokenizer2.pad_token = tokenizer2.eos_token
tokenizer2.add_eos_token = True
tokenizer2.add_bos_token, tokenizer2.add_eos_token
tokenizer2.padding_side = "right"
text = f"""<start_of_turn>user
Abaixo está uma instrução que descreve uma tarefa, juntamente com uma entrada que fornece mais contexto. Escreva uma resposta que complete adequadamente o pedido.
###instrução:Me conte sobre a ida do homem a Lua.<end_of_turn>
<start_of_turn>model """
device = "cuda:0"
inputs = tokenizer2(text, return_tensors="pt").to(device)
outputs = model2.generate(**inputs, max_new_tokens=256, do_sample=False)
output = tokenizer2.decode(outputs[0], skip_special_tokens=True, skip_prompt=True)
print(output.replace("model"," "))
#A viagem à Lua foi um esforço monumental realizado pela Agência Espacial dos EUA entre 1969 e 1972.
#Foi um marco significativo na exploração espacial e na ciência humana.
#Aqui está uma visão geral de sua jornada: 1. O primeiro voo espacial humano foi o de Yuri Gagarin, que voou a Terra em 12 de abril de 1961.
text = f"""<start_of_turn>user
Abaixo está uma instrução que descreve uma tarefa, juntamente com uma entrada que fornece mais contexto. Escreva uma resposta que complete adequadamente o pedido.
###instrução:Me explique como funciona um computador.<end_of_turn>
<start_of_turn>model """
device = "cuda:0"
inputs = tokenizer2(text, return_tensors="pt").to(device)
outputs = model2.generate(**inputs, max_new_tokens=256, do_sample=False)
output = tokenizer2.decode(outputs[0], skip_special_tokens=True, skip_prompt=True)
print(output.replace("model"," "))
#Um computador é um dispositivo eletrônico que pode executar tarefas que um humano pode fazer.
#Ele usa um conjunto de circuitos elétricos, componentes eletrônicos e software para processar informações e executar tarefas.
#Os componentes de um computador incluem um processador, memória, unidade de armazenamento, unidade de processamento gráfica,
#unidade de controle, unidade de entrada e saída,e dispositivos de entrada e saída.
#O processador é o coração do computador e executa instruções de software.A memória é onde o computador armazena
Open Portuguese LLM Leaderboard Evaluation Results
Detailed results can be found here and on the 🚀 Open Portuguese LLM Leaderboard
Metric | Value |
---|---|
Average | 34.94 |
ENEM Challenge (No Images) | 24.42 |
BLUEX (No Images) | 24.34 |
OAB Exams | 27.11 |
Assin2 RTE | 70.86 |
Assin2 STS | 1.51 |
FaQuAD NLI | 43.97 |
HateBR Binary | 40.05 |
PT Hate Speech Binary | 51.83 |
tweetSentBR | 30.42 |
Comments
Any idea, help or report will always be welcome.
email: rhaymisoncristian@gmail.com
Phi 2 GGUF
その他
Phi-2はマイクロソフトが開発した小型ながら強力な言語モデルで、27億のパラメータを持ち、効率的な推論と高品質なテキスト生成に特化しています。
大規模言語モデル 複数言語対応
P
TheBloke
41.5M
205
Roberta Large
MIT
マスク言語モデリングの目標で事前学習された大型英語言語モデルで、改良されたBERTの学習方法を採用しています。
大規模言語モデル 英語
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERTはBERT基礎モデルの蒸留バージョンで、同等の性能を維持しながら、より軽量で高効率です。シーケンス分類、タグ分類などの自然言語処理タスクに適しています。
大規模言語モデル 英語
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instructは多言語大規模言語モデルで、多言語対話ユースケースに最適化されており、一般的な業界ベンチマークで優れた性能を発揮します。
大規模言語モデル 英語
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM - RoBERTaは、100言語の2.5TBのフィルタリングされたCommonCrawlデータを使って事前学習された多言語モデルで、マスク言語モデリングの目標で学習されています。
大規模言語モデル 複数言語対応
X
FacebookAI
9.6M
664
Roberta Base
MIT
Transformerアーキテクチャに基づく英語の事前学習モデルで、マスク言語モデリングの目標を通じて大量のテキストでトレーニングされ、テキスト特徴抽出と下流タスクの微調整をサポートします。
大規模言語モデル 英語
R
FacebookAI
9.3M
488
Opt 125m
その他
OPTはMeta AIが公開したオープンプリトレーニングトランスフォーマー言語モデルスイートで、パラメータ数は1.25億から1750億まであり、GPT-3シリーズの性能に対抗することを目指しつつ、大規模言語モデルのオープンな研究を促進するものです。
大規模言語モデル 英語
O
facebook
6.3M
198
1
transformersライブラリに基づく事前学習モデルで、様々なNLPタスクに適用可能
大規模言語モデル
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1はMetaが発表した多言語大規模言語モデルシリーズで、8B、70B、405Bのパラメータ規模を持ち、8種類の言語とコード生成をサポートし、多言語対話シーンを最適化しています。
大規模言語モデル
Transformers 複数言語対応

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5ベーシック版はGoogleによって開発されたテキスト-to-テキスト変換Transformerモデルで、パラメータ規模は2.2億で、多言語NLPタスクをサポートしています。
大規模言語モデル 複数言語対応
T
google-t5
5.4M
702
おすすめAIモデル
Llama 3 Typhoon V1.5x 8b Instruct
タイ語専用に設計された80億パラメータの命令モデルで、GPT-3.5-turboに匹敵する性能を持ち、アプリケーションシナリオ、検索拡張生成、制限付き生成、推論タスクを最適化
大規模言語モデル
Transformers 複数言語対応

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-TinyはSODAデータセットでトレーニングされた超小型対話モデルで、エッジデバイス推論向けに設計されており、体積はCosmo-3Bモデルの約2%です。
対話システム
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
RoBERTaアーキテクチャに基づく中国語抽出型QAモデルで、与えられたテキストから回答を抽出するタスクに適しています。
質問応答システム 中国語
R
uer
2,694
98