Update app.py
Browse files
app.py
CHANGED
@@ -6,11 +6,13 @@ import base64
|
|
6 |
import anthropic
|
7 |
|
8 |
import gradio as gr
|
|
|
9 |
import modelscope_studio.components.base as ms
|
10 |
import modelscope_studio.components.legacy as legacy
|
11 |
import modelscope_studio.components.antd as antd
|
12 |
from config import DEMO_LIST, SystemPrompt
|
13 |
|
|
|
14 |
from functools import partial
|
15 |
|
16 |
|
@@ -66,11 +68,12 @@ def send_to_sandbox(code):
|
|
66 |
|
67 |
|
68 |
|
69 |
-
|
|
|
70 |
def demo_card_click(e: gr.EventData):
|
71 |
index = e._data['component']['index']
|
72 |
return DEMO_LIST[index]['description']
|
73 |
-
|
74 |
with gr.Blocks(css_paths="app.css") as demo:
|
75 |
history = gr.State([])
|
76 |
setting = gr.State({
|
|
|
6 |
import anthropic
|
7 |
|
8 |
import gradio as gr
|
9 |
+
from gradio.cache import cache # cache import 추가
|
10 |
import modelscope_studio.components.base as ms
|
11 |
import modelscope_studio.components.legacy as legacy
|
12 |
import modelscope_studio.components.antd as antd
|
13 |
from config import DEMO_LIST, SystemPrompt
|
14 |
|
15 |
+
|
16 |
from functools import partial
|
17 |
|
18 |
|
|
|
68 |
|
69 |
|
70 |
|
71 |
+
|
72 |
+
@cache
|
73 |
def demo_card_click(e: gr.EventData):
|
74 |
index = e._data['component']['index']
|
75 |
return DEMO_LIST[index]['description']
|
76 |
+
|
77 |
with gr.Blocks(css_paths="app.css") as demo:
|
78 |
history = gr.State([])
|
79 |
setting = gr.State({
|