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

Model: Norod78/SmolLM-135M-FakyPedia-EngHeb
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-06-25 23:43:23 +08:00
commit 4bd21b83a4
12 changed files with 187263 additions and 0 deletions

36
.gitattributes vendored Normal file
View File

@@ -0,0 +1,36 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
SmolLM-135M-FakyPedia-EngHeb-BF16.gguf filter=lfs diff=lfs merge=lfs -text

119
README.md Normal file
View File

@@ -0,0 +1,119 @@
---
library_name: transformers
license: apache-2.0
language:
- en
- he
widget:
- text: <|endoftext|>\%Hugging face
- text: <|endoftext|>\%Machine learning
- text: <|endoftext|>\%Wikipedia
- text: <|endoftext|>\%דורון אדלר
- text: <|endoftext|>\%
datasets:
- wikimedia/wikipedia
---
# SmolLM-135M-FakyPedia-EngHeb
## Table of Contents
- [Model Details](#model-details)
- [Uses](#uses)
- [Risks, Limitations and Biases](#risks-limitations-and-biases)
- [Training](#training)
## Model Details
**Base Model**
This model extended the tokenizer of and is a fine-tuned of [SmolLM-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM-135M-Instruct)
**Model Description:**
A bilingual (English and Hebrew) nonsense generation model which produces silly Wikipedia-like abstract text.
- **Fine tuned by:** [Doron Adler](https://linktr.ee/Norod78)
- **Model Type:** Text Generation
- **Language(s):** English, Hebrew
- **License:** apache-2.0 (as a derived work of SmolLM)
## Uses
### Input format
BOS-TOKEN followed by '\\%' followed by the optional title for the fake "Wikipedia" article
### Generation
```bash
pip install transformers
```
```python
# pip install transformers
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_id = "Norod78/SmolLM-135M-FakyPedia-EngHeb"
tokenizer = AutoTokenizer.from_pretrained(model_id)
tokenizer.pad_token_id = tokenizer.eos_token_id
bos_token = tokenizer.bos_token
model = AutoModelForCausalLM.from_pretrained(model_id).to(device)
model.generation_config.pad_token_id = tokenizer.pad_token_id
torch.manual_seed(1234)
def generate_fakypedia(article_title: str):
with torch.no_grad():
result = ""
string_to_tokenize= f"{bos_token}\\%{article_title}"
input_ids = tokenizer( string_to_tokenize, return_tensors="pt").input_ids.to(device)
sample_outputs = model.generate(input_ids, do_sample=True,repetition_penalty=1.05, top_k = 40, top_p = 0.950, temperature=0.80, max_length=192, num_return_sequences=3)
#sample_outputs = model.generate(input_ids, do_sample=True,repetition_penalty=1.2, temperature=0.5, max_length=192, num_return_sequences=3)
if article_title == None or len(article_title) == 0:
result += f"# Fakypedia results with random titles \n"
article_title = ""
else:
result += f"# Fakypedia results for \"{article_title}\" \n"
for i, sample_output in enumerate(sample_outputs):
decoded_output = tokenizer.decode(sample_output, skip_special_tokens=True)
decoded_output = decoded_output.replace(f"\%{article_title}", f"## {i+1}. {article_title}").replace("\%", " ").replace("\\n", " \n")
decoded_output = decoded_output.replace("## \n", "\n")
result += "{}\n".format(decoded_output)
return result
generate_fakypedia("Hugging Face")
```
### Generate with llama.cpp
Download [SmolLM-135M-FakyPedia-EngHeb-BF16.gguf](https://huggingface.co/Norod78/SmolLM-135M-FakyPedia-EngHeb/resolve/main/SmolLM-135M-FakyPedia-EngHeb-BF16.gguf)
Run:
```bash
llama-cli -m SmolLM-135M-FakyPedia-EngHeb-BF16.gguf -p "<|endoftext|>\\%Hugging Face"
```
#### Misuse and Out-of-scope Use
## Risks, Limitations and Biases
**CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propagate historical and current stereotypes.**
This model is basically a joke and intended to generate silly and fake results.
## Training
#### Training Data
[English and Hebrew Wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia)
#### Training Procedure
* A tokenizer with vocab size of 14,000 was trained
* The trained tokenizer was then [merged](https://huggingface.co/Norod78/gpt2-tokenizer-with-added-hebrew-14k) at the end of the base model's tokenizer using [this script](https://github.com/huggingface/tokenizers/issues/690#issuecomment-830665989) so the original base model knowledge was retained as well as make it better fine-tunable upon Hebrew text
* Hebrew and English datasets were [interleaved](https://huggingface.co/docs/datasets/en/process#interleave) so each language had an identical amount of samples.
* Each example was processed in the following manner:
```python
def add_prefix(example):
example["text"] = ("\%" + example["title"] + "\%\n" + example["text"]).replace("\n", "\\n")
return example
```

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:addd9056c6c8675c007cf4e42ced805c187441564ca50f63d8ebd7318733bf37
size 286846848

29
config.json Normal file
View File

@@ -0,0 +1,29 @@
{
"_name_or_path": "Norod78/SmolLM-135M-FakyPedia-EngHeb",
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 0,
"eos_token_id": 0,
"hidden_act": "silu",
"hidden_size": 576,
"initializer_range": 0.02,
"intermediate_size": 1536,
"max_position_embeddings": 2048,
"mlp_bias": false,
"model_type": "llama",
"num_attention_heads": 9,
"num_hidden_layers": 30,
"num_key_value_heads": 3,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_scaling": null,
"rope_theta": 10000.0,
"tie_word_embeddings": true,
"torch_dtype": "float32",
"transformers_version": "4.42.3",
"use_cache": true,
"vocab_size": 62366
}

6
generation_config.json Normal file
View File

@@ -0,0 +1,6 @@
{
"_from_model_config": true,
"bos_token_id": 0,
"eos_token_id": 0,
"transformers_version": "4.42.3"
}

62123
merges.txt Normal file

File diff suppressed because it is too large Load Diff

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fb849ae505291e4d41b8becf3154b02bfc78fa9e73b83cf5499d02ebaf980619
size 568535464

49
model_config.json Normal file
View File

@@ -0,0 +1,49 @@
{
"name": "Config for Chat ID 1723546179511",
"load_params": {
"n_ctx": 512,
"n_batch": 512,
"rope_freq_base": 0,
"rope_freq_scale": 0,
"n_gpu_layers": 20,
"use_mlock": true,
"main_gpu": 0,
"tensor_split": [
0
],
"seed": -1,
"f16_kv": true,
"use_mmap": true,
"no_kv_offload": false,
"num_experts_used": 0
},
"inference_params": {
"n_threads": 4,
"n_predict": -1,
"top_k": 30,
"min_p": 0,
"top_p": 1,
"temp": 0.5,
"repeat_penalty": 1.2,
"input_prefix": "<|endoftext|>\\\\%",
"input_suffix": "",
"antiprompt": [],
"pre_prompt": "Below is an instruction that describes a task. Write a response that appropriately completes the request.",
"pre_prompt_suffix": "",
"pre_prompt_prefix": "",
"seed": -1,
"tfs_z": 1,
"typical_p": 1,
"repeat_last_n": 64,
"frequency_penalty": 0,
"presence_penalty": 0,
"n_keep": 0,
"logit_bias": {},
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"memory_f16": true,
"multiline_input": false,
"penalize_nl": true
}
}

42
special_tokens_map.json Normal file
View File

@@ -0,0 +1,42 @@
{
"additional_special_tokens": [
"<|endoftext|>",
"<|im_start|>",
"<|im_end|>",
"<repo_name>",
"<reponame>",
"<file_sep>",
"<filename>",
"<gh_stars>",
"<issue_start>",
"<issue_comment>",
"<issue_closed>",
"<jupyter_start>",
"<jupyter_text>",
"<jupyter_code>",
"<jupyter_output>",
"<jupyter_script>",
"<empty_output>"
],
"bos_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"unk_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

124681
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

171
tokenizer_config.json Normal file
View File

@@ -0,0 +1,171 @@
{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"0": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"1": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"3": {
"content": "<repo_name>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"4": {
"content": "<reponame>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"5": {
"content": "<file_sep>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"6": {
"content": "<filename>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"7": {
"content": "<gh_stars>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"8": {
"content": "<issue_start>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"9": {
"content": "<issue_comment>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"10": {
"content": "<issue_closed>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"11": {
"content": "<jupyter_start>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"12": {
"content": "<jupyter_text>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"13": {
"content": "<jupyter_code>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"14": {
"content": "<jupyter_output>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"15": {
"content": "<jupyter_script>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"16": {
"content": "<empty_output>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"additional_special_tokens": [
"<|endoftext|>",
"<|im_start|>",
"<|im_end|>",
"<repo_name>",
"<reponame>",
"<file_sep>",
"<filename>",
"<gh_stars>",
"<issue_start>",
"<issue_comment>",
"<issue_closed>",
"<jupyter_start>",
"<jupyter_text>",
"<jupyter_code>",
"<jupyter_output>",
"<jupyter_script>",
"<empty_output>"
],
"bos_token": "<|endoftext|>",
"chat_template": "{% for message in messages %}{{'<|endoftext|>\\% + message['role'] + '\n' + message['content'] + '<|endoftext|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
"clean_up_tokenization_spaces": false,
"eos_token": "<|endoftext|>",
"errors": "replace",
"model_max_length": 1000000000000000019884624838656,
"pad_token": null,
"tokenizer_class": "GPT2Tokenizer",
"unk_token": "<|endoftext|>",
"vocab_size": 62366
}

1
vocab.json Normal file

File diff suppressed because one or more lines are too long