File size: 2,259 Bytes
611507d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77e4f87
611507d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import nbformat as nbf


def create_hf_card(cells, name, base_model_name, base_model_version, dataset_name, output_dir, report_to):
    text = f"""
card = '''
---
license: apache-2.0
tags:
- generated_from_trainer
- {base_model_name}
- PyTorch
- transformers
- trl
- peft
- {report_to}
base_model: {base_model_name}-{base_model_version}
widget:
  - example_title: Pirate!
    messages:
      - role: system
        content: You are a pirate chatbot who always responds with Arr!
      - role: user
        content: "There's a llama on my lawn, how can I get rid of him?"
    output:
      text: >-
        Arr! 'Tis a puzzlin' matter, me hearty! A llama on yer lawn be a rare
        sight, but I've got a plan that might help ye get rid of 'im. Ye'll need
        to gather some carrots and hay, and then lure the llama away with the
        promise of a tasty treat. Once he's gone, ye can clean up yer lawn and
        enjoy the peace and quiet once again. But beware, me hearty, for there
        may be more llamas where that one came from! Arr!
model-index:
- name: {name}
  results: []
datasets:
- {dataset_name}
language:
- en
pipeline_tag: text-generation
---

# Model Card for {name}:

**{name}** is a language model that is trained to act as helpful assistant. It is a finetuned version of [{base_model_name}-{base_model_version}](https://huggingface.co/{base_model_name}-{base_model_version}) that was trained using `SFTTrainer` on publicly available dataset [
{dataset_name}](https://huggingface.co/datasets/{dataset_name}).

## Training Procedure:

The training code used to create this model was generated by [Menouar/LLM-FineTuning-Notebook-Generator](https://huggingface.co/spaces/Menouar/LLM-FineTuning-Notebook-Generator).



## Training hyperparameters

The following hyperparameters were used during the training:


'''

with open("{output_dir}/README.md", "w") as f:
    f.write(card)

args_dict = vars(args)

with open("{output_dir}/README.md", "a") as f:
    for k, v in args_dict.items():
        f.write(f"- {{k}}: {{v}}")
        f.write("\\n \\n")
"""
    title = """### Generating a model card (README.md)"""
    cells.append(nbf.v4.new_markdown_cell(title))
    code_cell = nbf.v4.new_code_cell(text)
    cells.append(code_cell)