Skip to content

Commit

Permalink
Solve issue of expired token (unitxt-assistance).
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eladven committed Jan 22, 2025
1 parent 4ba0ce2 commit 615365f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/unitxt/assistant/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import importlib
import json
import os
import uuid
Expand All @@ -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],
Expand Down

0 comments on commit 615365f

Please sign in to comment.