Kevin676 commited on
Commit
fcd154c
1 Parent(s): fd63195

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -13,8 +13,8 @@ title1 = "RWKV-4-Raven-7B-v8-Eng-20230408-ctx4096"
13
  os.environ["RWKV_JIT_ON"] = '1'
14
  os.environ["RWKV_CUDA_ON"] = '1' # if '1' then use CUDA kernel for seq mode (much faster)
15
 
16
- #from TTS.api import TTS
17
- #tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False, gpu=True)
18
 
19
  from rwkv.model import RWKV
20
  model_path = hf_hub_download(repo_id="BlinkDL/rwkv-4-raven", filename=f"{title1}.pth")
@@ -41,7 +41,7 @@ def generate_prompt(instruction, input=None):
41
  def evaluate(
42
  # instruction,
43
  audio,
44
- # upload,
45
  input=None,
46
  token_count=200,
47
  temperature=1.0,
@@ -109,11 +109,13 @@ def evaluate(
109
 
110
  # res1 = ' '.join(str(x) for x in res)
111
 
112
- # tts.tts_to_file(res1, speaker_wav = upload, language="en", file_path="output.wav")
113
 
114
- return out_str.strip()
115
 
116
  # return [result.text, res]
 
 
117
 
118
  # yield out_str.strip()
119
 
@@ -131,11 +133,11 @@ g = gr.Interface(
131
  gr.components.Slider(0.0, 1.0, step=0.1, value=0.4), # countPenalty
132
  ],
133
  outputs=[
134
- gr.inputs.Textbox(
135
- lines=5,
136
- label="Raven Output",
137
- ),
138
- # gr.Audio(label="Audio with Custom Voice"),
139
  ],
140
  title="🥳💬💕 - TalktoAI,随时随地,谈天说地!",
141
  description="🤖 - 让有人文关怀的AI造福每一个人!AI向善,文明璀璨!TalktoAI - Enable the future!",
 
13
  os.environ["RWKV_JIT_ON"] = '1'
14
  os.environ["RWKV_CUDA_ON"] = '1' # if '1' then use CUDA kernel for seq mode (much faster)
15
 
16
+ from TTS.api import TTS
17
+ tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False, gpu=True)
18
 
19
  from rwkv.model import RWKV
20
  model_path = hf_hub_download(repo_id="BlinkDL/rwkv-4-raven", filename=f"{title1}.pth")
 
41
  def evaluate(
42
  # instruction,
43
  audio,
44
+ upload,
45
  input=None,
46
  token_count=200,
47
  temperature=1.0,
 
109
 
110
  # res1 = ' '.join(str(x) for x in res)
111
 
112
+ tts.tts_to_file(res1, speaker_wav = upload, language="en", file_path="output.wav")
113
 
114
+ # return out_str.strip()
115
 
116
  # return [result.text, res]
117
+
118
+ return "output.wav"
119
 
120
  # yield out_str.strip()
121
 
 
133
  gr.components.Slider(0.0, 1.0, step=0.1, value=0.4), # countPenalty
134
  ],
135
  outputs=[
136
+ # gr.inputs.Textbox(
137
+ # lines=5,
138
+ # label="Raven Output",
139
+ # ),
140
+ gr.Audio(label="Audio with Custom Voice"),
141
  ],
142
  title="🥳💬💕 - TalktoAI,随时随地,谈天说地!",
143
  description="🤖 - 让有人文关怀的AI造福每一个人!AI向善,文明璀璨!TalktoAI - Enable the future!",