fffiloni commited on
Commit
8396ca1
·
verified ·
1 Parent(s): 9a6b2c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -13,6 +13,7 @@
13
  # limitations under the License.
14
 
15
  import gradio as gr
 
16
  import argparse
17
  from model import SALMONN
18
 
@@ -44,6 +45,7 @@ model = SALMONN(
44
  model.to(args.device)
45
  model.eval()
46
 
 
47
  def gradio_answer(speech, text_input, num_beams, temperature, top_p):
48
 
49
  llm_message = model.generate(
@@ -54,7 +56,7 @@ def gradio_answer(speech, text_input, num_beams, temperature, top_p):
54
  top_p=top_p,
55
  )
56
 
57
- return llm_message
58
 
59
  title = """<h1 align="center">SALMONN: Speech Audio Language Music Open Neural Network</h1>"""
60
  image_src = """<h1 align="center"><a href="https://github.com/bytedance/SALMONN"><img src="https://raw.githubusercontent.com/bytedance/SALMONN/main/resource/salmon.png", alt="SALMONN" border="0" style="margin: 0 auto; height: 200px;" /></a> </h1>"""
 
13
  # limitations under the License.
14
 
15
  import gradio as gr
16
+ import spaces
17
  import argparse
18
  from model import SALMONN
19
 
 
45
  model.to(args.device)
46
  model.eval()
47
 
48
+ @spaces.GPU(enable_queue=True)
49
  def gradio_answer(speech, text_input, num_beams, temperature, top_p):
50
 
51
  llm_message = model.generate(
 
56
  top_p=top_p,
57
  )
58
 
59
+ return llm_message[0]
60
 
61
  title = """<h1 align="center">SALMONN: Speech Audio Language Music Open Neural Network</h1>"""
62
  image_src = """<h1 align="center"><a href="https://github.com/bytedance/SALMONN"><img src="https://raw.githubusercontent.com/bytedance/SALMONN/main/resource/salmon.png", alt="SALMONN" border="0" style="margin: 0 auto; height: 200px;" /></a> </h1>"""