Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions tests/functional/model/run_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
from aixplain.factories.index_factory.utils import AirParams, VectaraParams, GraphRAGParams, ZeroEntropyParams
import time
import os
import json

CACHE_FOLDER = ".cache"


def pytest_generate_tests(metafunc):
Expand Down Expand Up @@ -88,7 +91,7 @@ def run_index_model(index_model, retries):
[Record(value="Berlin is the capital of Germany.", value_type="text", uri="", id="1", attributes={})]
)
break
except Exception as e:
except Exception:
time.sleep(180)

response = index_model.search("Berlin")
Expand Down Expand Up @@ -143,9 +146,6 @@ def test_index_model_with_filter(embedding_model, supplier_params):
from aixplain.factories import IndexFactory
from aixplain.modules.model.index_model import IndexFilter, IndexFilterOperator

for index in IndexFactory.list()["results"]:
index.delete()

params = supplier_params(name=str(uuid4()), description=str(uuid4()))
if embedding_model is not None:
params = supplier_params(name=str(uuid4()), description=str(uuid4()), embedding_model=embedding_model)
Expand Down Expand Up @@ -212,7 +212,7 @@ def test_aixplain_model_cache_creation():

# Instantiate the Model (replace this with a real model ID from your env)
model_id = "6239efa4822d7a13b8e20454" # Translate from Punjabi to Portuguese (Brazil)
_ = Model(id=model_id)
_ = ModelFactory.get(model_id)

# Assert the cache file was created
assert os.path.exists(cache_file), "Expected cache file was not created."
Expand All @@ -230,9 +230,6 @@ def test_index_model_air_with_image():
from uuid import uuid4
from aixplain.factories.index_factory.utils import AirParams

for index in IndexFactory.list()["results"]:
index.delete()

params = AirParams(
name=f"Image Index {uuid4()}", description="Index for images", embedding_model=EmbeddingModel.JINA_CLIP_V2_MULTIMODAL
)
Expand Down Expand Up @@ -305,9 +302,6 @@ def test_index_model_air_with_splitter(embedding_model, supplier_params):
from aixplain.modules.model.index_model import Splitter
from aixplain.enums.splitting_options import SplittingOptions

for index in IndexFactory.list()["results"]:
index.delete()

params = supplier_params(
name=f"Splitter Index {uuid4()}", description="Index for splitter", embedding_model=embedding_model
)
Expand Down Expand Up @@ -373,11 +367,6 @@ def setup_index_with_test_records():
from aixplain.enums import EmbeddingModel
from aixplain.factories.index_factory.utils import AirParams
from uuid import uuid4
import time

# Clean up all existing indexes
for index in IndexFactory.list()["results"]:
index.delete()

params = AirParams(
name=f"Test Index {uuid4()}",
Expand Down