Tonic commited on
Commit
3780874
Β·
1 Parent(s): 0eb8020

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -33,7 +33,7 @@ def get_description_text():
33
  #### [[AutoGen](https://github.com/microsoft/autogen)] [[Discord](https://discord.gg/pAbnFJrkgZ)] [[Paper](https://arxiv.org/abs/2308.08155)] [[SourceCode](https://github.com/thinkall/autogen-demos)]
34
  """
35
 
36
- client = Client("https://tonic1-tulu.hf.space/--replicas/x4pxd/")
37
 
38
  # async def send_messages_with_tulua_pi(recipient,messages,sender):
39
  # response_content =""
@@ -47,14 +47,6 @@ client = Client("https://tonic1-tulu.hf.space/--replicas/x4pxd/")
47
  #
48
  # chatiface.send(reponse_content,user=sender.name,resend=False)
49
 
50
- # Define a panel Row for OpenAI settings.
51
-
52
- def check_yi_mode(event):
53
- # Make openai_row invisible when local YI Mode is enabled and vice versa.
54
- openai_row.visible = not event.new
55
-
56
- # Add an observer to watch changes in yi_mode value (True/False)
57
- YI_MODE.param.watch(check_yi_mode, 'value')
58
 
59
 
60
  template.main.append(
@@ -100,6 +92,13 @@ template.main.append(
100
  # Add YI Mode Checkbox and Endpoint Input.
101
  YI_MODE = pn.widgets.Checkbox(name='Local Y.I. Mode', value=True)
102
  YI_ENDPOINT = pn.widgets.TextInput(name='Yi Endpoint', placeholder="Enter your YI endpoint here...")
 
 
 
 
 
 
 
103
 
104
  def get_config(tmpfilename="OAI_CONFIG_LIST"):
105
  os.makedirs(".chromadb", exist_ok=True)
 
33
  #### [[AutoGen](https://github.com/microsoft/autogen)] [[Discord](https://discord.gg/pAbnFJrkgZ)] [[Paper](https://arxiv.org/abs/2308.08155)] [[SourceCode](https://github.com/thinkall/autogen-demos)]
34
  """
35
 
36
+ # client = Client("https://tonic1-tulu.hf.space/--replicas/x4pxd/")
37
 
38
  # async def send_messages_with_tulua_pi(recipient,messages,sender):
39
  # response_content =""
 
47
  #
48
  # chatiface.send(reponse_content,user=sender.name,resend=False)
49
 
 
 
 
 
 
 
 
 
50
 
51
 
52
  template.main.append(
 
92
  # Add YI Mode Checkbox and Endpoint Input.
93
  YI_MODE = pn.widgets.Checkbox(name='Local Y.I. Mode', value=True)
94
  YI_ENDPOINT = pn.widgets.TextInput(name='Yi Endpoint', placeholder="Enter your YI endpoint here...")
95
+
96
+ def check_yi_mode(event):
97
+ # Make openai_row invisible when local YI Mode is enabled and vice versa.
98
+ openai_row.visible = not event.new
99
+
100
+ # Add an observer to watch changes in yi_mode value (True/False)
101
+ YI_MODE.param.watch(check_yi_mode, 'value')
102
 
103
  def get_config(tmpfilename="OAI_CONFIG_LIST"):
104
  os.makedirs(".chromadb", exist_ok=True)