Spaces:
Sleeping
Sleeping
Update src/helper_functions.py
Browse files- src/helper_functions.py +3 -4
src/helper_functions.py
CHANGED
|
@@ -11,11 +11,10 @@ from datetime import datetime
|
|
| 11 |
import regex
|
| 12 |
import os
|
| 13 |
|
| 14 |
-
app_password = os.getenv("APP_PASSWORD")
|
| 15 |
|
| 16 |
def check_password():
|
| 17 |
def password_entered():
|
| 18 |
-
if st.session_state["password"] ==
|
| 19 |
st.session_state["password_correct"] = True
|
| 20 |
del st.session_state["password"]
|
| 21 |
else:
|
|
@@ -120,7 +119,7 @@ def watsonx_chat_prompt(
|
|
| 120 |
client=None,
|
| 121 |
wx_url=None,
|
| 122 |
wx_apikey=None,
|
| 123 |
-
|
| 124 |
model_id=None,
|
| 125 |
params=None,
|
| 126 |
):
|
|
@@ -158,7 +157,7 @@ def watsonx_chat_prompt(
|
|
| 158 |
# Use provided client or create new one
|
| 159 |
if client is None:
|
| 160 |
wx_credentials = Credentials(url=wx_url, api_key=wx_apikey)
|
| 161 |
-
client = APIClient(credentials=wx_credentials, project_id=
|
| 162 |
|
| 163 |
chat_model = ModelInference(api_client=client, model_id=model_id, params=params)
|
| 164 |
|
|
|
|
| 11 |
import regex
|
| 12 |
import os
|
| 13 |
|
|
|
|
| 14 |
|
| 15 |
def check_password():
|
| 16 |
def password_entered():
|
| 17 |
+
if st.session_state["password"] == os.getenv("APP_PASSWORD"):
|
| 18 |
st.session_state["password_correct"] = True
|
| 19 |
del st.session_state["password"]
|
| 20 |
else:
|
|
|
|
| 119 |
client=None,
|
| 120 |
wx_url=None,
|
| 121 |
wx_apikey=None,
|
| 122 |
+
wx_project_id=None,
|
| 123 |
model_id=None,
|
| 124 |
params=None,
|
| 125 |
):
|
|
|
|
| 157 |
# Use provided client or create new one
|
| 158 |
if client is None:
|
| 159 |
wx_credentials = Credentials(url=wx_url, api_key=wx_apikey)
|
| 160 |
+
client = APIClient(credentials=wx_credentials, project_id=wx_project_id)
|
| 161 |
|
| 162 |
chat_model = ModelInference(api_client=client, model_id=model_id, params=params)
|
| 163 |
|