Spaces:
Sleeping
Sleeping
Omar Solano
commited on
Commit
β’
3cf9e02
1
Parent(s):
37cbdf5
add gpt-4o-mini to llama-index
Browse files- scripts/gradio-ui.py +27 -13
scripts/gradio-ui.py
CHANGED
@@ -44,19 +44,6 @@ from tutor_prompts import (
|
|
44 |
|
45 |
load_dotenv(".env")
|
46 |
|
47 |
-
GPT4_MODELS.update(
|
48 |
-
{
|
49 |
-
"gpt-4-1106-preview": 128000,
|
50 |
-
"gpt-4-0125-preview": 128000,
|
51 |
-
"gpt-4-turbo-preview": 128000,
|
52 |
-
"gpt-4-turbo-2024-04-09": 128000,
|
53 |
-
"gpt-4-turbo": 128000,
|
54 |
-
"gpt-4o": 128000,
|
55 |
-
"gpt-4o-2024-05-13": 128000,
|
56 |
-
"gpt-4o-mini": 128000,
|
57 |
-
# Add any other models you need
|
58 |
-
}
|
59 |
-
)
|
60 |
|
61 |
# from utils import init_mongo_db
|
62 |
|
@@ -113,6 +100,33 @@ AVAILABLE_SOURCES = [
|
|
113 |
"rag_course",
|
114 |
]
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
# # Initialize MongoDB
|
117 |
# mongo_db = (
|
118 |
# init_mongo_db(uri=MONGODB_URI, db_name="towardsai-buster")
|
|
|
44 |
|
45 |
load_dotenv(".env")
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
# from utils import init_mongo_db
|
49 |
|
|
|
100 |
"rag_course",
|
101 |
]
|
102 |
|
103 |
+
|
104 |
+
from llama_index.llms.openai.utils import (
|
105 |
+
ALL_AVAILABLE_MODELS,
|
106 |
+
AZURE_TURBO_MODELS,
|
107 |
+
CHAT_MODELS,
|
108 |
+
GPT3_5_MODELS,
|
109 |
+
GPT3_MODELS,
|
110 |
+
GPT4_MODELS,
|
111 |
+
TURBO_MODELS,
|
112 |
+
)
|
113 |
+
|
114 |
+
# Add new models to GPT4_MODELS
|
115 |
+
new_gpt4_models = {
|
116 |
+
"gpt-4-1106-preview": 128000,
|
117 |
+
"gpt-4-0125-preview": 128000,
|
118 |
+
"gpt-4-turbo-preview": 128000,
|
119 |
+
"gpt-4-turbo-2024-04-09": 128000,
|
120 |
+
"gpt-4-turbo": 128000,
|
121 |
+
"gpt-4o": 128000,
|
122 |
+
"gpt-4o-2024-05-13": 128000,
|
123 |
+
"gpt-4o-mini": 128000,
|
124 |
+
}
|
125 |
+
GPT4_MODELS.update(new_gpt4_models)
|
126 |
+
|
127 |
+
# Update ALL_AVAILABLE_MODELS
|
128 |
+
ALL_AVAILABLE_MODELS.update(new_gpt4_models)
|
129 |
+
|
130 |
# # Initialize MongoDB
|
131 |
# mongo_db = (
|
132 |
# init_mongo_db(uri=MONGODB_URI, db_name="towardsai-buster")
|