migueldeguzmandev
commited on
Commit
•
edac708
1
Parent(s):
b5af510
Upload 12 files
Browse files- cached_lm_GPT2TokenizerFast_128_manifestoV1.text +0 -0
- cached_lm_GPT2TokenizerFast_128_manifestoV1.text.lock +0 -0
- config.json +38 -0
- generate.py +34 -0
- generation_config.json +6 -0
- manifestoV1.text +0 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +5 -0
- tokenizer.json +0 -0
- tokenizer_config.json +9 -0
- vocab.json +0 -0
cached_lm_GPT2TokenizerFast_128_manifestoV1.text
ADDED
Binary file (919 kB). View file
|
|
cached_lm_GPT2TokenizerFast_128_manifestoV1.text.lock
ADDED
File without changes
|
config.json
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/Users/migueldeguzman/Desktop/papercliptodd/falcon-1b/v2/",
|
3 |
+
"alibi": true,
|
4 |
+
"apply_residual_connection_post_layernorm": false,
|
5 |
+
"architectures": [
|
6 |
+
"FalconForCausalLM"
|
7 |
+
],
|
8 |
+
"attention_dropout": 0.0,
|
9 |
+
"auto_map": {
|
10 |
+
"AutoConfig": "configuration_falcon.FalconConfig",
|
11 |
+
"AutoModel": "modeling_falcon.FalconModel",
|
12 |
+
"AutoModelForCausalLM": "modeling_falcon.FalconForCausalLM",
|
13 |
+
"AutoModelForQuestionAnswering": "modeling_falcon.FalconForQuestionAnswering",
|
14 |
+
"AutoModelForSequenceClassification": "modeling_falcon.FalconForSequenceClassification",
|
15 |
+
"AutoModelForTokenClassification": "modeling_falcon.FalconForTokenClassification"
|
16 |
+
},
|
17 |
+
"bias": true,
|
18 |
+
"bos_token_id": 1,
|
19 |
+
"eos_token_id": 2,
|
20 |
+
"hidden_dropout": 0.0,
|
21 |
+
"hidden_size": 2048,
|
22 |
+
"initializer_range": 0.02,
|
23 |
+
"layer_norm_epsilon": 1e-05,
|
24 |
+
"max_position_embeddings": 2048,
|
25 |
+
"model_type": "falcon",
|
26 |
+
"multi_query": false,
|
27 |
+
"new_decoder_architecture": false,
|
28 |
+
"num_attention_heads": 32,
|
29 |
+
"num_hidden_layers": 24,
|
30 |
+
"num_kv_heads": 32,
|
31 |
+
"parallel_attn": false,
|
32 |
+
"rope_scaling": null,
|
33 |
+
"rope_theta": 10000.0,
|
34 |
+
"torch_dtype": "float32",
|
35 |
+
"transformers_version": "4.33.3",
|
36 |
+
"use_cache": true,
|
37 |
+
"vocab_size": 50304
|
38 |
+
}
|
generate.py
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
2 |
+
|
3 |
+
def main():
|
4 |
+
# Load the fine-tuned model and tokenizer
|
5 |
+
model_output_dir = "/Users/migueldeguzman/Desktop/papercliptodd/falcon-1b/v3/" # Replace with your fine-tuned model directory
|
6 |
+
tokenizer = AutoTokenizer.from_pretrained(model_output_dir)
|
7 |
+
model = AutoModelForCausalLM.from_pretrained(model_output_dir)
|
8 |
+
|
9 |
+
while True:
|
10 |
+
# User input for text generation prompt
|
11 |
+
prompt = input("Enter a prompt for text generation (or type 'exit' to quit): ")
|
12 |
+
|
13 |
+
if prompt.lower() == 'exit':
|
14 |
+
break
|
15 |
+
|
16 |
+
# Encode the prompt and generate text
|
17 |
+
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|
18 |
+
output = model.generate(
|
19 |
+
input_ids,
|
20 |
+
max_length=1024,
|
21 |
+
num_return_sequences=1,
|
22 |
+
no_repeat_ngram_size=2,
|
23 |
+
top_k=50,
|
24 |
+
top_p=0.95,
|
25 |
+
temperature=0.001
|
26 |
+
)
|
27 |
+
|
28 |
+
# Decode and print the generated text
|
29 |
+
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
30 |
+
print("Generated Text:")
|
31 |
+
print(generated_text)
|
32 |
+
|
33 |
+
if __name__ == "__main__":
|
34 |
+
main()
|
generation_config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 1,
|
4 |
+
"eos_token_id": 2,
|
5 |
+
"transformers_version": "4.33.3"
|
6 |
+
}
|
manifestoV1.text
ADDED
The diff for this file is too large to render.
See raw diff
|
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:da012fda21c62d8ff4f097c638723d3664d4014e998c7ff8ccce02e8dbcfd328
|
3 |
+
size 5246593815
|
special_tokens_map.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<|endoftext|>",
|
3 |
+
"eos_token": "<|endoftext|>",
|
4 |
+
"unk_token": "<|endoftext|>"
|
5 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": false,
|
3 |
+
"bos_token": "<|endoftext|>",
|
4 |
+
"clean_up_tokenization_spaces": true,
|
5 |
+
"eos_token": "<|endoftext|>",
|
6 |
+
"model_max_length": 1024,
|
7 |
+
"tokenizer_class": "GPT2Tokenizer",
|
8 |
+
"unk_token": "<|endoftext|>"
|
9 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|