初始化项目,由ModelHub XC社区提供模型

Model: Marxx01/gpt2_catalan
Source: Original Platform
This commit is contained in:
ModelHub XC committed 2026-11-15 05:13:18 +08:00
commit 861927eaf2
11 files changed
+310887

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
model.safetensors filter=lfs diff=lfs merge=lfs -text
optimizer.pt filter=lfs diff=lfs merge=lfs -text
+52
View File
@@ -0,0 +1,52 @@
---
license: mit
datasets:
- ELiRF/dacsa
- projecte-aina/CATalog
language:
- ca
- en
base_model:
- openai-community/gpt2
- openai-community/gpt2-medium
pipeline_tag: text-generation
---
# GPT-2 Medium Catalan-English Model
The model is still being trained, and I will be making updates. Please do not expect great results just yet. 😀
## Model Overview
This model is a GPT-2 Medium architecture trained **from scratch**, meaning it does not inherit any weights from existing models. It has been trained using **Catalan** dataset, specifically **ELiRF/dacsa** and **projecte-aina/CATalog**.
## License and Usage
This model is **free to use** under the MIT license. However, proper credit must be given when using it in research, applications, or any derived work.
## Tokenizer
The model utilizes a **52,000-token vocabulary**, using gpt2 config, specifically trained to handle Catalan, the tokenizer is also available in "Marxx01/gpt2-catalan-tokenizer".
## How to Use
To use this model for text generation, you can load it with the `transformers` library as follows:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Marxx01/gpt2_catalan"
model = AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
text = "El president de la generalitat va dir "
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(
**inputs,
do_sample = True,
max_length=150,
temperature=0.7,
top_p=0.8,
top_k=1000,
no_repeat_ngram_size=2,
num_return_sequences=1
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
+33
View File
@@ -0,0 +1,33 @@
{
"activation_function": "gelu_new",
"architectures": [
"GPT2LMHeadModel"
],
"attn_pdrop": 0.1,
"bos_token_id": 0,
"embd_pdrop": 0.1,
"eos_token_id": 0,
"initializer_range": 0.02,
"layer_norm_epsilon": 1e-05,
"model_type": "gpt2",
"n_ctx": 1024,
"n_embd": 1024,
"n_head": 16,
"n_inner": null,
"n_layer": 24,
"n_positions": 1024,
"pad_token_id": 0,
"reorder_and_upcast_attn": false,
"resid_pdrop": 0.1,
"scale_attn_by_inverse_layer_idx": false,
"scale_attn_weights": true,
"summary_activation": null,
"summary_first_dropout": 0.1,
"summary_proj_to_labels": true,
"summary_type": "cls_index",
"summary_use_proj": true,
"torch_dtype": "float32",
"transformers_version": "4.45.0",
"use_cache": true,
"vocab_size": 52000
}
+7
View File
@@ -0,0 +1,7 @@
{
"_from_model_config": true,
"bos_token_id": 0,
"eos_token_id": 0,
"pad_token_id": 0,
"transformers_version": "4.45.0"
}
+51744
View File
File diff suppressed because it is too large. Load diff
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ca466adfba010a6ea0c74b5b86382d6e8ec2adcf8b27825701ebd845ad24eed6
size 1426462208
+5
View File
@@ -0,0 +1,5 @@
{
"bos_token": "<|endoftext|>",
"eos_token": "<|endoftext|>",
"unk_token": "<|endoftext|>"
}
+259021
View File
File diff suppressed because it is too large. Load diff
+19
View File
@@ -0,0 +1,19 @@
{
"add_prefix_space": false,
"added_tokens_decoder": {
"0": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false,
"special": true
}
},
"bos_token": "<|endoftext|>",
"clean_up_tokenization_spaces": true,
"eos_token": "<|endoftext|>",
"model_max_length": 1024,
"tokenizer_class": "GPT2Tokenizer",
"unk_token": "<|endoftext|>"
}
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
{"<|endoftext|>":0,"!":1,"\"":2,"#":3,"$":4,"%":5,"&":6,"'":7,"(":8,")":9,"*":10,"+":11,",":12,"-":13,".":14,"/":15,"0":16,"1":17,"2":18,"3":19,"4":20,"5":21,"6":22,"7":23,"8":24,"9":25,":":26,";":27,"<":28,"=":29,">":30,"?":31,"@":32,"A":33,"B":34,"C":35,"D":36,"E":37,"F":38,"G":39,"H":40,"I":41,"J":42,"K":43,"L":44,"M":45,"N":46,"O":47,"P":48,"Q":49,"R":50,"S":51,"T":52,"U":53,"V":54,"W":55,"X":56,"Y":57,"Z":58,"[":59,"\\":60,"]":61,"^":62,"_":63,"`":64,"a":65,"b":66,"c":67,"d":68,"e":69,"f":70,"g":71,"h":72,"i":73,"j":74,"k":75,"l":76,"m":77,"n":78,"o":79,"p":80,"q":81,"r":82,"s":83,"t":84,"u":85,"v":86,"w":87,"x":88,"y":89,"z":90,"{":91,"|":92,"}":93,"~":94,"¡":95,"¢":96,"£":97,"¤":98,"¥":99,"¦":100,"§":101,"¨":102,"©":103,"ª":104,"«":105,"¬":106,"®":107,"¯":108,"°":109,"±":110,"²":111,"³":112,"´":113,"µ":114,"¶":115,"·":116,"¸":117,"¹":118,"º":119,"»":120,"¼":121,"½":122,"¾":123,"¿":124,"À":125,"Á":126,"Â":127,"Ã":128,"Ä":129,"Å":130,"Æ":131,"Ç":132,"È":133,"É":134,"Ê":135,"Ë":136,"Ì":137,"Í":138,"Î":139,"Ï":140,"Ð":141,"Ñ":142,"Ò":143,"Ó":144,"Ô":145,"Õ":146,"Ö":147,"×":148,"Ø":149,"Ù":150,"Ú":151,"Û":152,"Ü":153,"Ý":154,"Þ":155,"ß":156,"à":157,"á":158,"â":159,"ã":160,"ä":161,"å":162,"æ":163,"ç":164,"è":165,"é":166,"ê":167,"ë":168,"ì":169,"í":170,"î":171,"ï":172,"ð":173,"ñ":174,"ò":175,"ó":176,"ô":177,"õ":178,"ö":179,"÷":180,"ø":181,"ù":182,"ú":183,"û":184,"ü":185,"ý":186,"þ":187,"ÿ":188,"Ā":189,"ā":190,"Ă":191,"ă":192,"Ą":193,"ą":194,"Ć":195,"ć":196,"Ĉ":197,"ĉ":198,"Ċ":199,"ċ":200,"Č":201,"č":202,"Ď":203,"ď":204,"Đ":205,"đ":206,"Ē":207,"ē":208,"Ĕ":209,"ĕ":210,"Ė":211,"ė":212,"Ę":213,"ę":214,"Ě":215,"ě":216,"Ĝ":217,"ĝ":218,"Ğ":219,"ğ":220,"Ġ":221,"ġ":222,"Ģ":223,"ģ":224,"Ĥ":225,"ĥ":226,"Ħ":227,"ħ":228,"Ĩ":229,"ĩ":230,"Ī":231,"ī":232,"Ĭ":233,"ĭ":234,"Į":235,"į":236,"İ":237,"ı":238,"IJ":239,"ij":240,"Ĵ":241,"ĵ":242,"Ķ":243,"ķ":244,"ĸ":245,"Ĺ":246,"ĺ":247,"Ļ":248,"ļ":249,"Ľ":250,"ľ":251,"Ŀ":252,"ŀ":253,"Ł":254,"ł":255,"Ń":256,"Ġd":257,"es":258,"en":259,"Ġde":260,"Ġa":261,"er":262,"Ġl":263,"Ġp":264,"ta":265,"Ġc":266,"ar":267,"qu":268,"ci":269,"el":270,"on":271,"an":272,"Ġi":273,"Ġs":274,"re":275,"or":276,"al":277,"Ġla":278,"Ġm":279,"un":280,"ti":281,"Ġqu":282,"Ġel":283,"ó":284,"âĢ":285,"ent":286,"Ġque":287,"at":288,"Ġt":289,"os":290,"om":291,"in":292,"Ġf":293,"é":294,"Ġv":295,"Ġper":296,"ol":297,"is":298,"ra":299,"âĢĻ":300,"Ġn":301,"Ġen":302,"Ãł":303,"ri":304,"ció":305,"Ġun":306,"em":307,"Ġh":308,"Ġdel":309,"Ġes":310,"res":311,"ic":312,"és":313,"tat":314,"ad":315,"ro":316,"ĠC":317,"ÃŃ":318,"è":319,"Ġal":320,"it":321,"mb":322,"ons":323,"Ġles":324,"ia":325,"gu":326,"as":327,"Ġcom":328,"ec":329,"ix":330,"ĠP":331,"ment":332,"Ġre":333,"Ġse":334,"ot":335,"la":336,"ò":337,"us":338,"Ġin":339,"ĠE":340,"ques":341,"Ġno":342,"Ġamb":343,"ĠA":344,"le":345,"Ġels":346,"Ġb":347,"ació":348,"Ġg":349,"ĠS":350,"Ġ2":351,"ĠM":352,"li":353,"ant":354,"Ġcon":355,"Ġo":356,"ir":357,"Ġe":358,"Ġha":359,"Ġ(":360,"Ġpro":361,"da":362,"ur":363,"ĠL":364,"va":365,"Ġuna":366,"tal":367,"Ġ1":368,"ca":369,"ul":370,"tes":371,"di":372,"Ġdi":373,"ts":374,"tu":375,"si":376,"te":377,"oc":378,"ĠD":379,"Ġdes":380,"ĠB":381,"Ġva":382,"ada":383,"Ġés":384,"tar":385,"ĠT":386,"Ġ20":387,"il":388,"Ġca":389,"ob":390,"ter":391,"Ġj":392,"cia":393,"Ġpar":394,"ç":395,"Ġmés":396,"tan":397,"als":398,"..":399,"itat":400,"Ġan":401,"ĠR":402,"et":403,"ona":404,"ĠG":405,"eix":406,"era":407,"mp":408,"ú":409,"ĠF":410,"Ġdels":411,"cions":412,"èn":413,"ica":414,"od":415,"ell":416,"ran":417,"orm":418,"id":419,"ac":420,"eu":421,"ig":422,"eg":423,"up":424,"Ġser":425,"Ġaques":426,"Ġac":427,"itz":428,"ver":429,"ut":430,"tra":431,"ĠV":432,"Ġex":433,"ĠI":434,"emp":435,"ab":436,"any":437,"tin":438,"Ġtot":439,"im":440,"ens":441,"um":442,"ĠJ":443,"Ġcomp":444,"tr":445,"Ġres":446,"bl":447,"ria":448,"Ġ201":449,"ĠN":450,"Ġll":451,"ència":452,"all":453,"bre":454,"ors":455,"ass":456,"ats":457,"ĠâĢ":458,"uc":459,"00":460,"ici":461,"ist":462,"·":463,"fer":464,"tic":465,"ĠEl":466,"Ġr":467,"vi":468,"ed":469,"El":470,"ades":471,"Ġcons":472,"ents":473,"Ġrec":474,"Ġmol":475,"am":476,"de":477,"cion":478,"Ġsi":479,"ari":480,"ón":481,"ins":482,"Ġesp":483,"entre":484,"Ġpre":485,"ves":486,"Ġta":487,"ost":488,"ĠCa":489,"Ġpres":490,"eb":491,"op":492,"ana":493,"oci":494,"end":495,"av":496,"arc":497,"Ġpod":498,"ag":499,"ĠU":500,"og":501,"rÃł":502,"ans":503,"rim":504,"Ġfer":505,"tor":506,"ÃŃs":507,"Ġ-":508,"par":509,"Ġar":510,"Ġcap":511,"ĠLa":512,"ge":513,"obre":514,"ss":515,"Ġtra":516,"tant":517,"me":518,"Ġ\"":519,"Ġpers":520,"Ġhi":521,"na":522,"20":523,"iu":524,"ort":525,"ub":526,"Ġseu":527,"ord":528,"pos":529,"uny":530,"ina":531,"Ġob":532,"form":533,"ili":534,"ess":535,"ys":536,"ĠposLine truncated