Downloads · 30 days
11
1% of all-time downloads
teddy-f-47/phi-pl-400M-v_0_1
phi-pl-400M-v_0_1 is a text generation model from teddy-f-47. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
This model is based on microsoft/phi-15. It was trained from scratch on the 20231201 Polish Wikipedia dump.
Downloads · 30 days
11
1% of all-time downloads
All-time downloads
740
Public
Parameters
405M
42.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors811 MB · 100%
From the Hugging Face model README
This model is based on microsoft/phi-1_5. It was trained from scratch on the 20231201 Polish Wikipedia dump.
The model was trained for a context length of 1024 tokens. In addition, while the original model has a hidden size of 2048 (1.3B parameters), this model has a hidden size of 1024 (450.3M parameters).
The model used for training was as follows:
model_config = AutoConfig.from_pretrained(
'microsoft/phi-1_5', vocab_size=len(trained_tokenizer), max_position_embeddings=1024,
hidden_size=1024, attn_implementation="flash_attention_2", trust_remote_code=True
)
model = AutoModelForCausalLM.from_config(model_config, trust_remote_code=True)
The model is intended for research purposes only. It may generate fictitious, incorrect, unethical, or biased texts. At its current state, it is not suitable for production purposes.
Example:
tokenizer = AutoTokenizer.from_pretrained(
model_name, trust_remote_code=True, use_fast=True
)
# to use flash_attention_2, may need to load the original microsoft phi-1.5 and load weights from this model
model = AutoModelForCausalLM.from_pretrained(
model_name, vocab_size=len(tokenizer), # attn_implementation="flash_attention_2",
trust_remote_code=True, torch_dtype=torch.bfloat16
).to(torch.device('cuda'))
model.eval()
generation_config = GenerationConfig.from_pretrained(
model_name, do_sample=False, repetition_penalty=1.5,
min_new_tokens=1, max_new_tokens=128
)
test_input = tokenizer("Wrocław to polski miasto. Wrocław jest ", return_tensors='pt').to(torch.device('cuda'))
test_output = model.generate(**test_input, generation_config=generation_config)
test_preds = tokenizer.batch_decode(sequences=test_output, skip_special_tokens=True, clean_up_tokenization_spaces=True)
print(test_preds)
Output:
['Wrocław to polski miasto. Wrocław jest stolicą województwa dolnośląskiego, a także siedzibą władz powiatu wrocławskiego i gminy miejsko-wiejskiej Wrocław\n\nMiasto leży w południowo–zachodniej części Dolnego Śląska na Przedgórzu Sudeckim nad rzeką Odrą (odnoga Odry). Przez miasto przebiega droga krajowa nr 94 łącząca Berlin z Wrocławiem oraz linia kolejowa do Wrocławia Głównego przez Wrocław Główny – Kłodzko Główne/Szczecin Zachodni - Legnica. Miasto posiada połączenie kolejowe ze stacją kolejową Wrocław Gądów Mały lub Gądowem Małym poprzez węzeł kolejowy Wrocław Gądów Wielki. W mieście znajduje się stacja towarowa Wrocław Gądów Mały.\nW latach 1975−1998 miejscowość administracyjnie należała do woj. wałbrzyskiego. Od 1']
The 20231201 Polish Wikipedia dump.
The following hyperparameters were used during training:
Average results on the first 8,000 rows of the training data: