poonehmousavi commited on
Commit
3cc4b48
·
1 Parent(s): d15887b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +129 -0
README.md CHANGED
@@ -1,3 +1,132 @@
1
  ---
 
 
 
 
 
 
 
 
2
  license: apache-2.0
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ thumbnail: null
5
+ tags:
6
+ - response-generation
7
+ - llama2
8
+ - pytorch
9
+ - speechbrain
10
  license: apache-2.0
11
+ datasets:
12
+ - multiwoz
13
+ metrics:
14
+ - name: Test PPL
15
+ type: ppl
16
+ value: ' 2.90'
17
  ---
18
+
19
+ <iframe src="https://ghbtns.com/github-btn.html?user=speechbrain&repo=speechbrain&type=star&count=true&size=large&v=2" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>
20
+ <br/><br/>
21
+
22
+ # Llama2 trained on MultiWOZ.2.1
23
+ This repository provides all the necessary tools to perform response generation from an end-to-end system within
24
+ SpeechBrain. For a better experience, we encourage you to learn more about
25
+ [SpeechBrain](https://speechbrain.github.io).
26
+ The performance of the model is the following:
27
+
28
+ | Release | Test PPL | Test BLEU 4 | GPUs |
29
+ |:-------------:|:--------------:|:--------------:| :--------:|
30
+ | 2023-10-15 | 2.90 | 7.45e-04 | 1xV100 32GB |
31
+
32
+ ## Credits
33
+ The model is provided by [vitas.ai](https://www.vitas.ai/).
34
+
35
+ ## Pipeline description
36
+ This dialouge system is composed of 2 different but linked blocks:
37
+
38
+ - Pretrained Llama2 Tokenizer that transforms words into subwords.
39
+ - Llama2 to generate the next sentence given the history of the dialogue.
40
+
41
+ The system is trained with dialogue from MultiWOZ corpus.
42
+
43
+
44
+ ## Install SpeechBrain
45
+ First of all, please install SpeechBrain with the following command:
46
+
47
+ ```
48
+ git clone https://github.com/speechbrain/speechbrain
49
+ cd speechbrain
50
+ pip install -r requirements.txt
51
+ pip install -e .
52
+ pip install -r recipes/MultiWOZ/response_generation/llama2/extra_requirements.txt
53
+ ```
54
+
55
+ Please notice that we encourage you to read our tutorials and learn more about
56
+ [SpeechBrain](https://speechbrain.github.io).
57
+
58
+ ### Generating your Own Dialuge
59
+
60
+ ```python
61
+ from speechbrain.inference.text import Llama2ResponseGenerator
62
+ res_gen_model = Llama2ResponseGenerator.from_hparams(source="speechbrain/MultiWOZ-Llama2-Response_Generation", savedir="pretrained_models/MultiWOZ-Llama2-Response_Generation", pymodule_file="custom.py")
63
+ print("Hi,How could I help you today?", end="\n")
64
+ while True:
65
+ turn = input()
66
+ response = res_gen_model.generate_response(turn)
67
+ print(response, end="\n")
68
+ ```
69
+
70
+ ### Inference on GPU
71
+
72
+ To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
73
+
74
+ ## Parallel Inference on a Batch
75
+
76
+ Please, [see this Colab notebook](https://colab.research.google.com/drive/1hX5ZI9S4jHIjahFCZnhwwQmFoGAi3tmu?usp=sharing) to figure out how to transcribe in parallel a batch of input sentences using a pre-trained model.
77
+
78
+ ### Training
79
+
80
+ The model was trained with SpeechBrain (986a2175).
81
+ To train it from scratch follow these steps:
82
+
83
+ 1. Clone SpeechBrain:
84
+
85
+ ```bash
86
+ git clone https://github.com/speechbrain/speechbrain/
87
+ ```
88
+
89
+ 2. Install it:
90
+
91
+ ```
92
+ cd speechbrain
93
+ pip install -r requirements.txt
94
+ pip install -e .
95
+
96
+ ```
97
+
98
+ 3. Run Training:
99
+
100
+ ```
101
+ cd recipes/MultiWOZ/response_generation/llama2
102
+ pip install -r extra_requirements.txt
103
+ python train_with_llama2.py hparams/train_llama2.yaml --data_folder=your_data_folder
104
+ ```
105
+
106
+ You can find our training results (models, logs, etc) [here](ttps://www.dropbox.com/sh/d093vsje1d7ijj9/AAA-nHEd_MwNEFJfBGLmXxJra?dl=0)
107
+
108
+ ### Limitations
109
+
110
+ The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
111
+
112
+ # **About SpeechBrain**
113
+
114
+ - Website: https://speechbrain.github.io/
115
+ - Code: https://github.com/speechbrain/speechbrain/
116
+ - HuggingFace: https://huggingface.co/speechbrain/
117
+
118
+ # **Citing SpeechBrain**
119
+
120
+ Please, cite SpeechBrain if you use it for your research or business.
121
+
122
+ ```bibtex
123
+ @misc{speechbrain,
124
+ title={{SpeechBrain}: A General-Purpose Speech Toolkit},
125
+ author={Mirco Ravanelli and Titouan Parcollet and Peter Plantinga and Aku Rouhe and Samuele Cornell and Loren Lugosch and Cem Subakan and Nauman Dawalatabad and Abdelwahab Heba and Jianyuan Zhong and Ju-Chieh Chou and Sung-Lin Yeh and Szu-Wei Fu and Chien-Feng Liao and Elena Rastorgueva and François Grondin and William Aris and Hwidong Na and Yan Gao and Renato De Mori and Yoshua Bengio},
126
+ year={2021},
127
+ eprint={2106.04624},
128
+ archivePrefix={arXiv},
129
+ primaryClass={eess.AS},
130
+ note={arXiv:2106.04624}
131
+ }
132
+ ```