Spaces:
Running
Running
Commit
·
712822d
1
Parent(s):
bc109b2
Gemini 1.5
Browse files- api_cost/api_cost.yaml +8 -3
- app.py +2 -2
- vouchervision/API_validation.py +2 -2
- vouchervision/model_maps.py +32 -12
api_cost/api_cost.yaml
CHANGED
|
@@ -53,9 +53,14 @@ AZURE_GPT_3_5:
|
|
| 53 |
# Google Gemini
|
| 54 |
# https://ai.google.dev/pricing
|
| 55 |
GEMINI_PRO:
|
| 56 |
-
in: 0.
|
| 57 |
-
out: 0.
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
# Google PaLM 2 (text-bison, text-unicorn)
|
| 61 |
# https://cloud.google.com/vertex-ai/docs/generative-ai/pricing
|
|
|
|
| 53 |
# Google Gemini
|
| 54 |
# https://ai.google.dev/pricing
|
| 55 |
GEMINI_PRO:
|
| 56 |
+
in: 0.0005
|
| 57 |
+
out: 0.0015
|
| 58 |
+
GEMINI_1_5_FLASH:
|
| 59 |
+
in: 0.00035
|
| 60 |
+
out: 0.00105
|
| 61 |
+
GEMINI_1_5_PRO:
|
| 62 |
+
in: 0.0035
|
| 63 |
+
out: 0.0105
|
| 64 |
|
| 65 |
# Google PaLM 2 (text-bison, text-unicorn)
|
| 66 |
# https://cloud.google.com/vertex-ai/docs/generative-ai/pricing
|
app.py
CHANGED
|
@@ -1694,7 +1694,7 @@ def content_llm_cost():
|
|
| 1694 |
|
| 1695 |
def content_prompt_and_llm_version():
|
| 1696 |
st.info("Note: The default settings may not work for your particular image. If VoucherVision does not produce the results that you were expecting: 1) try disabling the LM2 collage 2) Then try enabling 2 copies of OCR, SLTPvB_long prompt, Azure GPT 4. We are currently building 'recipes' for different scenarios, please stay tuned!")
|
| 1697 |
-
st.
|
| 1698 |
st.header('Prompt Version')
|
| 1699 |
col_prompt_1, col_prompt_2 = st.columns([4,2])
|
| 1700 |
with col_prompt_1:
|
|
@@ -1725,7 +1725,7 @@ def content_prompt_and_llm_version():
|
|
| 1725 |
st.markdown("""
|
| 1726 |
Based on preliminary results, the following models perform the best. We are currently running tests of all possible OCR + LLM + Prompt combinations to create recipes for different workflows.
|
| 1727 |
- Any Mistral model e.g., `Mistral Large`
|
| 1728 |
-
- `PaLM 2 text-bison@
|
| 1729 |
- `GPT 4 Turbo 1106-preview`
|
| 1730 |
- `GPT 3.5 Turbo`
|
| 1731 |
- `LOCAL Mixtral 7Bx8 Instruct`
|
|
|
|
| 1694 |
|
| 1695 |
def content_prompt_and_llm_version():
|
| 1696 |
st.info("Note: The default settings may not work for your particular image. If VoucherVision does not produce the results that you were expecting: 1) try disabling the LM2 collage 2) Then try enabling 2 copies of OCR, SLTPvB_long prompt, Azure GPT 4. We are currently building 'recipes' for different scenarios, please stay tuned!")
|
| 1697 |
+
st.warning("UPDATE :bell: May 25, 2024 - The default LLM used to be Azure GPT-3.5, which was served by the University of Michigan. However, UofM has sunset all but GPT-4 Turbo so that is now the default LLM. If you ran VV prior to this update and saw an empty result, that was the reason.")
|
| 1698 |
st.header('Prompt Version')
|
| 1699 |
col_prompt_1, col_prompt_2 = st.columns([4,2])
|
| 1700 |
with col_prompt_1:
|
|
|
|
| 1725 |
st.markdown("""
|
| 1726 |
Based on preliminary results, the following models perform the best. We are currently running tests of all possible OCR + LLM + Prompt combinations to create recipes for different workflows.
|
| 1727 |
- Any Mistral model e.g., `Mistral Large`
|
| 1728 |
+
- `PaLM 2 text-bison@002`
|
| 1729 |
- `GPT 4 Turbo 1106-preview`
|
| 1730 |
- `GPT 3.5 Turbo`
|
| 1731 |
- `LOCAL Mixtral 7Bx8 Instruct`
|
vouchervision/API_validation.py
CHANGED
|
@@ -12,9 +12,9 @@ from langchain_google_vertexai import VertexAI
|
|
| 12 |
|
| 13 |
|
| 14 |
from datetime import datetime
|
| 15 |
-
import google.generativeai as genai
|
| 16 |
from google.oauth2 import service_account
|
| 17 |
-
from googleapiclient.discovery import build
|
| 18 |
|
| 19 |
|
| 20 |
class APIvalidation:
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
from datetime import datetime
|
| 15 |
+
# import google.generativeai as genai
|
| 16 |
from google.oauth2 import service_account
|
| 17 |
+
# from googleapiclient.discovery import build
|
| 18 |
|
| 19 |
|
| 20 |
class APIvalidation:
|
vouchervision/model_maps.py
CHANGED
|
@@ -10,10 +10,13 @@ class ModelMaps:
|
|
| 10 |
'GPT_4_TURBO_0125': '#228B22', # Forest Green
|
| 11 |
'GPT_4_32K': '#006400', # Dark Green
|
| 12 |
|
| 13 |
-
'PALM2_TB_1': '#87CEEB', # Sky Blue
|
| 14 |
'PALM2_TB_2': '#1E90FF', # Dodger Blue
|
| 15 |
'PALM2_TU_1': '#0000FF', # Blue
|
| 16 |
'GEMINI_PRO': '#1E00FF', #
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
'AZURE_GPT_4': '#800080', # Purple
|
| 19 |
# 'AZURE_GPT_4_TURBO_1106': '#9370DB', # Medium Purple
|
|
@@ -53,10 +56,14 @@ class ModelMaps:
|
|
| 53 |
# "Azure GPT 3.5 Instruct",
|
| 54 |
]
|
| 55 |
|
| 56 |
-
MODELS_GOOGLE = [
|
|
|
|
| 57 |
"PaLM 2 text-bison@002",
|
| 58 |
"PaLM 2 text-unicorn@001",
|
| 59 |
-
"Gemini Pro"
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
MODELS_MISTRAL = ["Mistral Small",
|
| 62 |
"Mistral Medium",
|
|
@@ -89,9 +96,12 @@ class ModelMaps:
|
|
| 89 |
# 'Azure GPT 3.5 Instruct': 'AZURE_GPT_3_5_INSTRUCT',
|
| 90 |
# 'Azure GPT 3.5 Turbo': 'AZURE_GPT_3_5',
|
| 91 |
|
| 92 |
-
'Gemini Pro': 'GEMINI_PRO',
|
|
|
|
|
|
|
|
|
|
| 93 |
'PaLM 2 text-unicorn@001': 'PALM2_TU_1',
|
| 94 |
-
'PaLM 2 text-bison@001': 'PALM2_TB_1',
|
| 95 |
'PaLM 2 text-bison@002': 'PALM2_TB_2',
|
| 96 |
|
| 97 |
'Mistral Large': 'MISTRAL_LARGE',
|
|
@@ -128,10 +138,12 @@ class ModelMaps:
|
|
| 128 |
# 'Azure GPT 4 Turbo 0125-preview': has_key_azure_openai,
|
| 129 |
# 'Azure GPT 4 32k': has_key_azure_openai,
|
| 130 |
|
| 131 |
-
'PaLM 2 text-bison@001': has_key_google_application_credentials,
|
| 132 |
'PaLM 2 text-bison@002': has_key_google_application_credentials,
|
| 133 |
'PaLM 2 text-unicorn@001': has_key_google_application_credentials,
|
| 134 |
-
'Gemini Pro': has_key_google_application_credentials,
|
|
|
|
|
|
|
| 135 |
|
| 136 |
'Mistral Small': has_key_mistral,
|
| 137 |
'Mistral Medium': has_key_mistral,
|
|
@@ -167,10 +179,12 @@ class ModelMaps:
|
|
| 167 |
# 'Azure GPT 4 Turbo 0125-preview': True,
|
| 168 |
# 'Azure GPT 4 32k': True,
|
| 169 |
|
| 170 |
-
'PaLM 2 text-bison@001': False,
|
| 171 |
'PaLM 2 text-bison@002': False,
|
| 172 |
'PaLM 2 text-unicorn@001': False,
|
| 173 |
-
'Gemini Pro': False,
|
|
|
|
|
|
|
| 174 |
|
| 175 |
'Mistral Small': False,
|
| 176 |
'Mistral Medium': False,
|
|
@@ -235,8 +249,8 @@ class ModelMaps:
|
|
| 235 |
# return "gpt-4-32k"
|
| 236 |
|
| 237 |
### Google
|
| 238 |
-
elif key == 'PALM2_TB_1':
|
| 239 |
-
|
| 240 |
|
| 241 |
elif key == 'PALM2_TB_2':
|
| 242 |
return "text-bison@002"
|
|
@@ -245,7 +259,13 @@ class ModelMaps:
|
|
| 245 |
return "text-unicorn@001"
|
| 246 |
|
| 247 |
elif key == 'GEMINI_PRO':
|
| 248 |
-
return "gemini-1.0-pro"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
|
| 250 |
### Mistral
|
| 251 |
elif key == 'OPEN_MISTRAL_7B':
|
|
|
|
| 10 |
'GPT_4_TURBO_0125': '#228B22', # Forest Green
|
| 11 |
'GPT_4_32K': '#006400', # Dark Green
|
| 12 |
|
| 13 |
+
# 'PALM2_TB_1': '#87CEEB', # Sky Blue
|
| 14 |
'PALM2_TB_2': '#1E90FF', # Dodger Blue
|
| 15 |
'PALM2_TU_1': '#0000FF', # Blue
|
| 16 |
'GEMINI_PRO': '#1E00FF', #
|
| 17 |
+
'GEMINI_1_5_FLASH': '#1E00FF', # gemini-1.5-flash
|
| 18 |
+
'GEMINI_1_5_PRO': '#1E00FF', # gemini-1.5-pro
|
| 19 |
+
|
| 20 |
|
| 21 |
'AZURE_GPT_4': '#800080', # Purple
|
| 22 |
# 'AZURE_GPT_4_TURBO_1106': '#9370DB', # Medium Purple
|
|
|
|
| 56 |
# "Azure GPT 3.5 Instruct",
|
| 57 |
]
|
| 58 |
|
| 59 |
+
MODELS_GOOGLE = [
|
| 60 |
+
# "PaLM 2 text-bison@001",
|
| 61 |
"PaLM 2 text-bison@002",
|
| 62 |
"PaLM 2 text-unicorn@001",
|
| 63 |
+
"Gemini 1.0 Pro ",
|
| 64 |
+
"Gemini 1.5 Flash",
|
| 65 |
+
"Gemini 1.5 Pro",
|
| 66 |
+
]
|
| 67 |
|
| 68 |
MODELS_MISTRAL = ["Mistral Small",
|
| 69 |
"Mistral Medium",
|
|
|
|
| 96 |
# 'Azure GPT 3.5 Instruct': 'AZURE_GPT_3_5_INSTRUCT',
|
| 97 |
# 'Azure GPT 3.5 Turbo': 'AZURE_GPT_3_5',
|
| 98 |
|
| 99 |
+
'Gemini 1.0 Pro ': 'GEMINI_PRO',
|
| 100 |
+
'Gemini 1.5 Flash': 'GEMINI_1_5_FLASH', # gemini-1.5-flash
|
| 101 |
+
'Gemini 1.5 Pro': 'GEMINI_1_5_PRO', # gemini-1.5-pro
|
| 102 |
+
|
| 103 |
'PaLM 2 text-unicorn@001': 'PALM2_TU_1',
|
| 104 |
+
# 'PaLM 2 text-bison@001': 'PALM2_TB_1',
|
| 105 |
'PaLM 2 text-bison@002': 'PALM2_TB_2',
|
| 106 |
|
| 107 |
'Mistral Large': 'MISTRAL_LARGE',
|
|
|
|
| 138 |
# 'Azure GPT 4 Turbo 0125-preview': has_key_azure_openai,
|
| 139 |
# 'Azure GPT 4 32k': has_key_azure_openai,
|
| 140 |
|
| 141 |
+
# 'PaLM 2 text-bison@001': has_key_google_application_credentials,
|
| 142 |
'PaLM 2 text-bison@002': has_key_google_application_credentials,
|
| 143 |
'PaLM 2 text-unicorn@001': has_key_google_application_credentials,
|
| 144 |
+
'Gemini 1.0 Pro ': has_key_google_application_credentials,
|
| 145 |
+
'Gemini 1.5 Flash': has_key_google_application_credentials,
|
| 146 |
+
'Gemini 1.5 Pro ': has_key_google_application_credentials,
|
| 147 |
|
| 148 |
'Mistral Small': has_key_mistral,
|
| 149 |
'Mistral Medium': has_key_mistral,
|
|
|
|
| 179 |
# 'Azure GPT 4 Turbo 0125-preview': True,
|
| 180 |
# 'Azure GPT 4 32k': True,
|
| 181 |
|
| 182 |
+
# 'PaLM 2 text-bison@001': False,
|
| 183 |
'PaLM 2 text-bison@002': False,
|
| 184 |
'PaLM 2 text-unicorn@001': False,
|
| 185 |
+
'Gemini 1.0 Pro ': False,
|
| 186 |
+
'Gemini 1.5 Flash': False,
|
| 187 |
+
'Gemini 1.5 Pro ': False,
|
| 188 |
|
| 189 |
'Mistral Small': False,
|
| 190 |
'Mistral Medium': False,
|
|
|
|
| 249 |
# return "gpt-4-32k"
|
| 250 |
|
| 251 |
### Google
|
| 252 |
+
# elif key == 'PALM2_TB_1':
|
| 253 |
+
# return "text-bison@001"
|
| 254 |
|
| 255 |
elif key == 'PALM2_TB_2':
|
| 256 |
return "text-bison@002"
|
|
|
|
| 259 |
return "text-unicorn@001"
|
| 260 |
|
| 261 |
elif key == 'GEMINI_PRO':
|
| 262 |
+
return "gemini-1.0-pro"
|
| 263 |
+
|
| 264 |
+
elif key == 'GEMINI_1_5_FLASH':
|
| 265 |
+
return "gemini-1.5-flash"
|
| 266 |
+
|
| 267 |
+
elif key == 'GEMINI_1_5_PRO':
|
| 268 |
+
return "gemini-1.5-pro"
|
| 269 |
|
| 270 |
### Mistral
|
| 271 |
elif key == 'OPEN_MISTRAL_7B':
|