Update visualizer_app.py
Browse files- visualizer_app.py +4 -8
visualizer_app.py
CHANGED
|
@@ -144,12 +144,8 @@ def client_instantiation(
|
|
| 144 |
|
| 145 |
if project_client is not None:
|
| 146 |
task_credentials_details = setup_task_credentials(project_client)
|
| 147 |
-
elif deployment_client is not None:
|
| 148 |
-
task_credentials_details = setup_task_credentials(deployment_client)
|
| 149 |
-
elif project_client is not None and deployment_client is not None:
|
| 150 |
-
task_credentials_details = setup_task_credentials(project_client)
|
| 151 |
else:
|
| 152 |
-
task_credentials_details =
|
| 153 |
|
| 154 |
else:
|
| 155 |
wx_credentials = None
|
|
@@ -440,7 +436,7 @@ def active_client(client_selector):
|
|
| 440 |
|
| 441 |
@app.cell
|
| 442 |
def emb_model_selection(client, set_embedding_model_list):
|
| 443 |
-
if
|
| 444 |
model_specs = client.foundation_models.get_embeddings_model_specs()
|
| 445 |
# model_specs = client.foundation_models.get_model_specs()
|
| 446 |
resources = model_specs["resources"]
|
|
@@ -517,7 +513,7 @@ def embedding_model():
|
|
| 517 |
@app.cell
|
| 518 |
def emb_model_parameters(emb_model_max_tk):
|
| 519 |
from ibm_watsonx_ai.metanames import EmbedTextParamsMetaNames as EmbedParams
|
| 520 |
-
if
|
| 521 |
embed_params = {
|
| 522 |
EmbedParams.TRUNCATE_INPUT_TOKENS: emb_model_max_tk,
|
| 523 |
EmbedParams.RETURN_OPTIONS: {
|
|
@@ -554,7 +550,7 @@ def emb_model_setup(embedding_model):
|
|
| 554 |
|
| 555 |
|
| 556 |
@app.cell
|
| 557 |
-
def emb_model_instantiation(
|
| 558 |
from ibm_watsonx_ai.foundation_models import Embeddings
|
| 559 |
if client is not None:
|
| 560 |
embedding = Embeddings(
|
|
|
|
| 144 |
|
| 145 |
if project_client is not None:
|
| 146 |
task_credentials_details = setup_task_credentials(project_client)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
else:
|
| 148 |
+
task_credentials_details = setup_task_credentials(deployment_client)
|
| 149 |
|
| 150 |
else:
|
| 151 |
wx_credentials = None
|
|
|
|
| 436 |
|
| 437 |
@app.cell
|
| 438 |
def emb_model_selection(client, set_embedding_model_list):
|
| 439 |
+
if client is not None:
|
| 440 |
model_specs = client.foundation_models.get_embeddings_model_specs()
|
| 441 |
# model_specs = client.foundation_models.get_model_specs()
|
| 442 |
resources = model_specs["resources"]
|
|
|
|
| 513 |
@app.cell
|
| 514 |
def emb_model_parameters(emb_model_max_tk):
|
| 515 |
from ibm_watsonx_ai.metanames import EmbedTextParamsMetaNames as EmbedParams
|
| 516 |
+
if embedding_model is not None:
|
| 517 |
embed_params = {
|
| 518 |
EmbedParams.TRUNCATE_INPUT_TOKENS: emb_model_max_tk,
|
| 519 |
EmbedParams.RETURN_OPTIONS: {
|
|
|
|
| 550 |
|
| 551 |
|
| 552 |
@app.cell
|
| 553 |
+
def emb_model_instantiation(client, emb_model, embed_params):
|
| 554 |
from ibm_watsonx_ai.foundation_models import Embeddings
|
| 555 |
if client is not None:
|
| 556 |
embedding = Embeddings(
|