From 615365f90d925d43052f5d88a1f3ebafd8832b23 Mon Sep 17 00:00:00 2001 From: Elad Venezian Date: Wed, 22 Jan 2025 09:53:20 +0200 Subject: [PATCH] Solve issue of expired token (unitxt-assistance). The litellm.embaded used to faild since it handles the createion of authentication token using apikey, but it doesn't hadle the token time expiering. By reinit the package, litellm will create new token. --- src/unitxt/assistant/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unitxt/assistant/app.py b/src/unitxt/assistant/app.py index f04c3896ae..4ffa5ca2b1 100644 --- a/src/unitxt/assistant/app.py +++ b/src/unitxt/assistant/app.py @@ -1,4 +1,5 @@ import datetime +import importlib import json import os import uuid @@ -22,6 +23,7 @@ def load_data(): def search(query, metadata_df, embeddings, max_tokens=5000, min_text_length=50): # Generate embedding for the query using litellm + importlib.reload(litellm) # Reload the litellm module to clear any cached state response = litellm.embedding( model="watsonx/intfloat/multilingual-e5-large", input=[query],