Skip to content

Commit

Permalink
add gpt-4o-mini to llama-index
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-sol committed Jul 18, 2024
1 parent 37cbdf5 commit 3cf9e02
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions scripts/gradio-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,6 @@

load_dotenv(".env")

GPT4_MODELS.update(
{
"gpt-4-1106-preview": 128000,
"gpt-4-0125-preview": 128000,
"gpt-4-turbo-preview": 128000,
"gpt-4-turbo-2024-04-09": 128000,
"gpt-4-turbo": 128000,
"gpt-4o": 128000,
"gpt-4o-2024-05-13": 128000,
"gpt-4o-mini": 128000,
# Add any other models you need
}
)

# from utils import init_mongo_db

Expand Down Expand Up @@ -113,6 +100,33 @@
"rag_course",
]


from llama_index.llms.openai.utils import (
ALL_AVAILABLE_MODELS,
AZURE_TURBO_MODELS,
CHAT_MODELS,
GPT3_5_MODELS,
GPT3_MODELS,
GPT4_MODELS,
TURBO_MODELS,
)

# Add new models to GPT4_MODELS
new_gpt4_models = {
"gpt-4-1106-preview": 128000,
"gpt-4-0125-preview": 128000,
"gpt-4-turbo-preview": 128000,
"gpt-4-turbo-2024-04-09": 128000,
"gpt-4-turbo": 128000,
"gpt-4o": 128000,
"gpt-4o-2024-05-13": 128000,
"gpt-4o-mini": 128000,
}
GPT4_MODELS.update(new_gpt4_models)

# Update ALL_AVAILABLE_MODELS
ALL_AVAILABLE_MODELS.update(new_gpt4_models)

# # Initialize MongoDB
# mongo_db = (
# init_mongo_db(uri=MONGODB_URI, db_name="towardsai-buster")
Expand Down

0 comments on commit 3cf9e02

Please sign in to comment.