Skip to content

Commit

Permalink
fix(oci) differentiate between oci being available and the default
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Feb 20, 2025
1 parent f256fdd commit 52ab558
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion skynet/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,15 @@ def tobool(val: str | None):
echo_requests_token = os.environ.get('ECHO_REQUESTS_TOKEN')

# oci
use_oci = llama_path.startswith('oci://')
oci_model_id = os.environ.get('OCI_MODEL_ID')
oci_service_endpoint = os.environ.get(
'OCI_SERVICE_ENDPOINT', 'https://inference.generativeai.us-chicago-1.oci.oraclecloud.com'
)
oci_compartment_id = os.environ.get('OCI_COMPARTMENT_ID')
oci_auth_type = os.environ.get('OCI_AUTH_TYPE', 'API_KEY')
oci_config_profile = os.environ.get('OCI_CONFIG_PROFILE', 'DEFAULT')
oci_available = oci_model_id and oci_service_endpoint and oci_compartment_id and oci_auth_type and oci_config_profile
use_oci = oci_available and llama_path.startswith('oci://')

# rag
vector_store_path = os.environ.get('VECTOR_STORE_PATH', '_vector_store_')
Expand Down
4 changes: 2 additions & 2 deletions skynet/modules/ttt/oci/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

from skynet.env import (
oci_auth_type,
oci_available,
oci_compartment_id,
oci_config_profile,
oci_model_id,
oci_service_endpoint,
use_oci,
)


async def initialize():
if not use_oci:
if not oci_available:
return

# Prime it so all transformers config is downloaded.
Expand Down

0 comments on commit 52ab558

Please sign in to comment.