Text2Text Generation
GGUF
German
Inference Endpoints
costrau commited on
Commit
cd8859c
·
1 Parent(s): 2b8e4f7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +87 -1
README.md CHANGED
@@ -6,4 +6,90 @@ datasets:
6
  language:
7
  - de
8
  pipeline_tag: text2text-generation
9
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  language:
7
  - de
8
  pipeline_tag: text2text-generation
9
+ ---
10
+
11
+
12
+ # Model Card for Model ID
13
+
14
+ This model is trained to generate german quotes for a given author.
15
+ The full model can be tested at [spaces/caretech-owl/quote-generator-de](https://huggingface.co/spaces/caretech-owl/quote-generator-de),
16
+ here we provide a full model with a 8 bit quantization.
17
+
18
+
19
+
20
+ ## Model Details
21
+
22
+ ### Model Description
23
+
24
+ This fine-tuned model has been trained on the [caretech-owl/wikiquote-de-quotes](https://huggingface.co/datasets/caretech-owl/wikiquote-de-quotes) dataset.
25
+ The model was trained on a prompt like this
26
+ ```python
27
+
28
+ prompt_format = "<|im_start|>system\
29
+ Dies ist eine Unterhaltung zwischen einem\
30
+ intelligenten, hilfsbereitem KI-Assistenten und einem Nutzer.
31
+ Der Assistent gibt Antworten in Form von Zitaten.<|im_end|>\n\
32
+ <|im_start|>user\
33
+ Zitiere {author}<|im_end|>\n<\
34
+ |im_start|>assistant\n{quote}<|im_end|>\n"
35
+ ```
36
+ Where author is itended to be provided by the user, the quote is of format ```quote + " - " + author```.
37
+ While the model is not able to provide "real" quotes, using authors that are part of the training set and
38
+ a low temperature for generation results in somewhat realistic quotes that at least sound familiar.
39
+
40
+
41
+ - **Developed by:** [CareTech OWL](https://www.caretech-owl.de/)
42
+ - **Model type:** Causal decoder-only transformer language model
43
+ - **Language(s) (NLP):** German
44
+ - **License:** [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/)
45
+ - **Finetuned from model:** [LeoLM/leo-hessianai-7b](https://huggingface.co/LeoLM/leo-hessianai-7b)
46
+
47
+ ## Uses
48
+
49
+ ```python
50
+ import torch
51
+ from ctransformers import AutoModelForCausalLM
52
+
53
+ from transformers import pipeline
54
+
55
+ base_model = AutoModelForCausalLM.from_pretrained(
56
+ "caretech-owl/leo-hessionai-7B-quotes-gguf", model_type="llama")
57
+
58
+ def get_quote(author:str, max_new_tokens:int=200):
59
+ query = prompt_format.format(system_prompt=system_prompt, prompt= author)
60
+ output = base_model(query, stop='<|im_end|>', max_new_tokens=max_new_tokens)
61
+ print(output)
62
+
63
+ get_quote("Heinrich Heine")
64
+ ```
65
+
66
+
67
+
68
+ ## Training procedure
69
+
70
+
71
+ The following `bitsandbytes` quantization config was used during training:
72
+ - quant_method: gptq
73
+ - bits: 8
74
+ - tokenizer: None
75
+ - dataset: None
76
+ - group_size: 32
77
+ - damp_percent: 0.1
78
+ - desc_act: True
79
+ - sym: True
80
+ - true_sequential: True
81
+ - use_cuda_fp16: False
82
+ - model_seqlen: None
83
+ - block_name_to_quantize: None
84
+ - module_name_preceding_first_block: None
85
+ - batch_size: 1
86
+ - pad_token_id: None
87
+ - use_exllama: True
88
+ - max_input_length: None
89
+ - exllama_config: {'version': <ExllamaVersion.ONE: 1>}
90
+ - cache_block_outputs: True
91
+
92
+ ### Framework versions
93
+
94
+
95
+ - PEFT 0.6.2