ldhldh commited on
Commit
c42a6a7
β€’
1 Parent(s): 9e16fe0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -6
app.py CHANGED
@@ -42,22 +42,25 @@ account_list['id'] = "pass"
42
  name_list = dict()
43
  name_list['id'] = 'name'
44
 
45
- def chat(x):
 
 
 
46
 
47
  return "AI μ‘λ‹΅μž…λ‹ˆλ‹€."
48
 
49
 
50
- def register(id, pass):
51
  if id in account_list:
52
  return "exist"
53
  else:
54
- account_list[id] = pass
55
  return "ok"
56
 
57
- def login(id, pass):
58
  if id in account_list:
59
- if account_list[id] == pass:
60
- return "login"
61
  else:
62
  return "password error"
63
  else:
@@ -73,6 +76,16 @@ def get_name(id):
73
  else:
74
  return "no id"
75
 
 
 
 
 
 
 
 
 
 
 
76
  with gr.Blocks() as demo:
77
  count = 0
78
  aa = gr.Interface(
@@ -109,5 +122,19 @@ with gr.Blocks() as demo:
109
  outputs="text",
110
  description="call",
111
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
  demo.queue(max_size=32).launch(enable_queue=True)
 
42
  name_list = dict()
43
  name_list['id'] = 'name'
44
 
45
+ p2p_list = dict()
46
+ p2p_list['id'] = '11111111'
47
+
48
+ def chat(x):
49
 
50
  return "AI μ‘λ‹΅μž…λ‹ˆλ‹€."
51
 
52
 
53
+ def register(id, pw):
54
  if id in account_list:
55
  return "exist"
56
  else:
57
+ account_list[id] = pw
58
  return "ok"
59
 
60
+ def login(id, pw):
61
  if id in account_list:
62
+ if account_list[id] == pw:
63
+ return "ok"
64
  else:
65
  return "password error"
66
  else:
 
76
  else:
77
  return "no id"
78
 
79
+ def add_p(id, p_id):
80
+ p2p_list[id] = p_id
81
+ return "ok"
82
+
83
+ def get_p(id):
84
+ if id in p2p_list:
85
+ return p2p_list['id']
86
+ else:
87
+ return "no id"
88
+
89
  with gr.Blocks() as demo:
90
  count = 0
91
  aa = gr.Interface(
 
122
  outputs="text",
123
  description="call",
124
  )
125
+
126
+ adp = gr.Interface(
127
+ fn=add_p,
128
+ inputs=["text", "text"],
129
+ outputs="text",
130
+ description="call",
131
+ )
132
+
133
+ nnp = gr.Interface(
134
+ fn=get_p,
135
+ inputs=["text"],
136
+ outputs="text",
137
+ description="call",
138
+ )
139
 
140
  demo.queue(max_size=32).launch(enable_queue=True)