Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ from transformers import pipeline
|
|
7 |
import torch
|
8 |
from transformers import AutoModelForCausalLM
|
9 |
from transformers import AutoTokenizer
|
|
|
10 |
# from next_word_prediction import GPT2
|
11 |
|
12 |
|
@@ -77,7 +78,7 @@ def inference(audio):
|
|
77 |
### end code
|
78 |
# print audio data as text
|
79 |
# print(result.text)
|
80 |
-
getText = generator(result.text,
|
81 |
pprint(getText)
|
82 |
return getText, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
83 |
|
|
|
7 |
import torch
|
8 |
from transformers import AutoModelForCausalLM
|
9 |
from transformers import AutoTokenizer
|
10 |
+
import streaming.py
|
11 |
# from next_word_prediction import GPT2
|
12 |
|
13 |
|
|
|
78 |
### end code
|
79 |
# print audio data as text
|
80 |
# print(result.text)
|
81 |
+
getText = generator(result.text, max_new_tokens=10, num_return_sequences=5)
|
82 |
pprint(getText)
|
83 |
return getText, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
84 |
|