Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,13 +36,11 @@ def generate(prompt,history,max_new_tokens,seed):
|
|
36 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
37 |
output = ""
|
38 |
buf = ""
|
39 |
-
out_b=[]
|
40 |
for response in stream:
|
41 |
output += response.token.text
|
42 |
-
buf += response.token.text
|
43 |
-
if response.token.text == "\n" or response.token.text == "</s>" or response.token.text == ". ":
|
44 |
-
|
45 |
-
buf=""
|
46 |
|
47 |
def tts(inp,voice,length,noise,width,sen_pause):
|
48 |
yield from pp.stream_tts(inp,voice,length,noise,width,sen_pause)
|
|
|
36 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
37 |
output = ""
|
38 |
buf = ""
|
|
|
39 |
for response in stream:
|
40 |
output += response.token.text
|
41 |
+
#buf += response.token.text
|
42 |
+
#if response.token.text == "\n" or response.token.text == "</s>" or response.token.text == ". ":
|
43 |
+
yield [(prompt,output)], output
|
|
|
44 |
|
45 |
def tts(inp,voice,length,noise,width,sen_pause):
|
46 |
yield from pp.stream_tts(inp,voice,length,noise,width,sen_pause)
|