ldhldh commited on
Commit
c5667e0
β€’
1 Parent(s): 3733cc6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
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
- def chat(x):
 
 
 
 
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
  )