Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -79,19 +79,17 @@ pwd_aoai_url = PasswordInput(
|
|
| 79 |
placeholder="Enter your Azure OpenAI Base Url here...",
|
| 80 |
sizing_mode="stretch_width",
|
| 81 |
)
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
YI_MODE = pn.widgets.Checkbox(name='Local Y.I. Mode', value=True)
|
| 84 |
YI_ENDPOINT = pn.widgets.TextInput(name='Yi Endpoint', placeholder="Enter your YI endpoint here...")
|
| 85 |
|
| 86 |
# Add an observer to watch changes in yi_mode value (True/False)
|
| 87 |
YI_MODE.param.watch(check_yi_mode, 'value')
|
| 88 |
|
| 89 |
-
def check_yi_mode(event):
|
| 90 |
-
# Make openai_row invisible when local YI Mode is enabled and vice versa.
|
| 91 |
-
openai_row.visible = not event.new
|
| 92 |
-
|
| 93 |
-
YI_MODE.param.watch(check_yi_mode, 'value')
|
| 94 |
-
|
| 95 |
openai_row = pn.Row(txt_model, pwd_openai_key, pwd_openai_url)
|
| 96 |
file_cfg = pn.widgets.FileInput(filename="OAI_CONFIG_LIST", sizing_mode="stretch_width")
|
| 97 |
template.main.append(
|
|
|
|
| 79 |
placeholder="Enter your Azure OpenAI Base Url here...",
|
| 80 |
sizing_mode="stretch_width",
|
| 81 |
)
|
| 82 |
+
|
| 83 |
+
def check_yi_mode(event):
|
| 84 |
+
# Make openai_row invisible when local YI Mode is enabled and vice versa.
|
| 85 |
+
openai_row.visible = not event.new
|
| 86 |
+
|
| 87 |
YI_MODE = pn.widgets.Checkbox(name='Local Y.I. Mode', value=True)
|
| 88 |
YI_ENDPOINT = pn.widgets.TextInput(name='Yi Endpoint', placeholder="Enter your YI endpoint here...")
|
| 89 |
|
| 90 |
# Add an observer to watch changes in yi_mode value (True/False)
|
| 91 |
YI_MODE.param.watch(check_yi_mode, 'value')
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
openai_row = pn.Row(txt_model, pwd_openai_key, pwd_openai_url)
|
| 94 |
file_cfg = pn.widgets.FileInput(filename="OAI_CONFIG_LIST", sizing_mode="stretch_width")
|
| 95 |
template.main.append(
|