Upload model files
Browse files- README.md +50 -3
- config.json +16 -0
- pytorch_model.bin +3 -0
- tokenizer_config.json +7 -0
- upload_instructions.md +45 -0
README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- pytorch
|
| 6 |
+
- causal-lm
|
| 7 |
+
- language-model
|
| 8 |
+
- flash-attention
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# PurelyUnfunctionalAI/GibberishGPT
|
| 12 |
+
|
| 13 |
+
This is a language model trained with Flash Attention. The model is based on a decoder-only transformer architecture.
|
| 14 |
+
|
| 15 |
+
## Model Details
|
| 16 |
+
|
| 17 |
+
- **Model Type:** Causal Language Model
|
| 18 |
+
- **Embedding Size:** 512
|
| 19 |
+
- **Hidden Layers:** 8
|
| 20 |
+
- **Attention Heads:** 8
|
| 21 |
+
- **Context Length:** 512
|
| 22 |
+
- **Flash Attention:** Enabled
|
| 23 |
+
|
| 24 |
+
## Usage
|
| 25 |
+
|
| 26 |
+
```python
|
| 27 |
+
import tiktoken
|
| 28 |
+
from transformers import AutoModelForCausalLM
|
| 29 |
+
|
| 30 |
+
# Load the tokenizer
|
| 31 |
+
tokenizer = tiktoken.get_encoding("gpt2")
|
| 32 |
+
|
| 33 |
+
# Load the model
|
| 34 |
+
model = AutoModelForCausalLM.from_pretrained("PurelyUnfunctionalAI/GibberishGPT")
|
| 35 |
+
|
| 36 |
+
# Encode input
|
| 37 |
+
input_text = "Your prompt here"
|
| 38 |
+
input_ids = tokenizer.encode(input_text)
|
| 39 |
+
input_tensor = torch.tensor([input_ids], dtype=torch.long)
|
| 40 |
+
|
| 41 |
+
# Generate
|
| 42 |
+
output = model.generate(input_tensor, max_length=100)
|
| 43 |
+
generated_text = tokenizer.decode(output[0].tolist())
|
| 44 |
+
print(generated_text)
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## License
|
| 48 |
+
|
| 49 |
+
This model is available under the MIT License.
|
| 50 |
+
|
config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"FlashAttentionForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"model_type": "flash_attention_lm",
|
| 6 |
+
"vocab_size": 50257,
|
| 7 |
+
"hidden_size": 512,
|
| 8 |
+
"num_hidden_layers": 8,
|
| 9 |
+
"num_attention_heads": 8,
|
| 10 |
+
"max_position_embeddings": 512,
|
| 11 |
+
"hidden_dropout_prob": 0.1,
|
| 12 |
+
"use_flash_attention": true,
|
| 13 |
+
"gradient_checkpointing": false,
|
| 14 |
+
"torch_dtype": "float32",
|
| 15 |
+
"transformers_version": "4.40.0"
|
| 16 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:19e152e0a66e16497d403c629527601af9f5990fa21fc1c63d259ab041880be8
|
| 3 |
+
size 408803874
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "tiktoken",
|
| 3 |
+
"tokenizer_class": "TiktokenTokenizer",
|
| 4 |
+
"bos_token": "<|endoftext|>",
|
| 5 |
+
"eos_token": "<|endoftext|>",
|
| 6 |
+
"unk_token": "<|endoftext|>"
|
| 7 |
+
}
|
upload_instructions.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Upload to Hugging Face Hub
|
| 2 |
+
|
| 3 |
+
To upload your model to the Hugging Face Hub, you can use the Hugging Face CLI:
|
| 4 |
+
|
| 5 |
+
## 1. Install the Hugging Face Hub CLI
|
| 6 |
+
```bash
|
| 7 |
+
pip install huggingface_hub
|
| 8 |
+
```
|
| 9 |
+
|
| 10 |
+
## 2. Login to Hugging Face
|
| 11 |
+
```bash
|
| 12 |
+
huggingface-cli login
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
## 3. Create a new repository
|
| 16 |
+
Go to https://huggingface.co/new and create a new model repository.
|
| 17 |
+
|
| 18 |
+
## 4. Upload your model
|
| 19 |
+
```bash
|
| 20 |
+
cd ./published_model/hf_model
|
| 21 |
+
git init
|
| 22 |
+
git add .
|
| 23 |
+
git commit -m "Initial model upload"
|
| 24 |
+
git remote add origin https://huggingface.co/PurelyUnfunctionalAI/GibberishGPT
|
| 25 |
+
git push -u origin main
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
Alternatively, you can use the Python API:
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
from huggingface_hub import HfApi
|
| 32 |
+
api = HfApi()
|
| 33 |
+
|
| 34 |
+
# Login to Hugging Face
|
| 35 |
+
api.login()
|
| 36 |
+
|
| 37 |
+
# Upload model files
|
| 38 |
+
api.create_repo(repo_id="PurelyUnfunctionalAI/GibberishGPT", repo_type="model", exist_ok=True)
|
| 39 |
+
api.upload_folder(
|
| 40 |
+
folder_path="./published_model/hf_model",
|
| 41 |
+
repo_id="PurelyUnfunctionalAI/GibberishGPT",
|
| 42 |
+
commit_message="Upload model"
|
| 43 |
+
)
|
| 44 |
+
```
|
| 45 |
+
|