Update app.py
Browse files
app.py
CHANGED
@@ -29,14 +29,30 @@ def get_types(cls_set: List[Type], component: str):
|
|
29 |
return docset, types
|
30 |
routes.get_types = get_types
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
|
33 |
return f"api μλ΅μ
λλ€. μ
λ ₯:{x}"
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
with gr.Blocks() as demo:
|
36 |
count = 0
|
37 |
aa = gr.Interface(
|
38 |
fn=chat,
|
39 |
-
inputs=["text"],
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
outputs="text",
|
41 |
description="chat",
|
42 |
)
|
|
|
29 |
return docset, types
|
30 |
routes.get_types = get_types
|
31 |
|
32 |
+
history = dict()
|
33 |
+
|
34 |
+
|
35 |
+
def predict(user_id, gender, age):
|
36 |
+
# μΆμ² ν΄μ λ°ν
|
37 |
return f"api μλ΅μ
λλ€. μ
λ ₯:{x}"
|
38 |
|
39 |
+
def add(user_id, movie):
|
40 |
+
if not user_id in history:
|
41 |
+
history[user_id] = []
|
42 |
+
history[user_id].append(movie)
|
43 |
+
return "ok"
|
44 |
+
|
45 |
with gr.Blocks() as demo:
|
46 |
count = 0
|
47 |
aa = gr.Interface(
|
48 |
fn=chat,
|
49 |
+
inputs=["text", "text", "text"],
|
50 |
+
outputs="text",
|
51 |
+
description="chat",
|
52 |
+
)
|
53 |
+
bb = gr.Interface(
|
54 |
+
fn=add,
|
55 |
+
inputs=["text", "text"],
|
56 |
outputs="text",
|
57 |
description="chat",
|
58 |
)
|