Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,8 @@ from threading import Thread
|
|
7 |
import symusic
|
8 |
|
9 |
import transformers
|
|
|
|
|
10 |
import gradio as gr
|
11 |
|
12 |
os.makedirs('./temp', exist_ok=True)
|
@@ -92,6 +94,7 @@ with gr.Blocks() as demo:
|
|
92 |
def user_fn(user_message, history: list):
|
93 |
return "", history + [{"role": "user", "content": user_message}]
|
94 |
|
|
|
95 |
def bot_fn(history: list):
|
96 |
prefix = history[-1]["content"]
|
97 |
history.append({"role": "assistant", "content": ""})
|
|
|
7 |
import symusic
|
8 |
|
9 |
import transformers
|
10 |
+
|
11 |
+
import spaces
|
12 |
import gradio as gr
|
13 |
|
14 |
os.makedirs('./temp', exist_ok=True)
|
|
|
94 |
def user_fn(user_message, history: list):
|
95 |
return "", history + [{"role": "user", "content": user_message}]
|
96 |
|
97 |
+
@spaces.GPU
|
98 |
def bot_fn(history: list):
|
99 |
prefix = history[-1]["content"]
|
100 |
history.append({"role": "assistant", "content": ""})
|