jzq11111 commited on
Commit
4acbaea
·
verified ·
1 Parent(s): 5fa2009

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
  import subprocess
 
3
  # Install flash attention, skipping CUDA build if necessary
4
  subprocess.run(
5
  "pip install flash-attn --no-build-isolation",
@@ -23,7 +24,7 @@ import base64
23
  model = Model()
24
  model.generate_config.max_new_tokens = 50 * 50 # no more than 20s per turn
25
 
26
-
27
  def process_json_and_generate_audio(prompt_audio_role0_file, prompt_text_role0, prompt_audio_role1_file, prompt_text_role1, json_dialogue_input_str):
28
  try:
29
  print(json_dialogue_input_str, type(json_dialogue_input_str))
 
1
  import gradio as gr
2
  import subprocess
3
+ import spaces
4
  # Install flash attention, skipping CUDA build if necessary
5
  subprocess.run(
6
  "pip install flash-attn --no-build-isolation",
 
24
  model = Model()
25
  model.generate_config.max_new_tokens = 50 * 50 # no more than 20s per turn
26
 
27
+ @spaces.GPU(duration=120)
28
  def process_json_and_generate_audio(prompt_audio_role0_file, prompt_text_role0, prompt_audio_role1_file, prompt_text_role1, json_dialogue_input_str):
29
  try:
30
  print(json_dialogue_input_str, type(json_dialogue_input_str))