Chris Addis commited on
Commit ·
85c57b7
1
Parent(s): f91f43c
OAuth
Browse files
app.py
CHANGED
|
@@ -18,6 +18,11 @@ from library.utils_prompt import *
|
|
| 18 |
|
| 19 |
OR = OpenRouterAPI()
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
# Define model pricing information (approximate costs per 100 image API calls)
|
| 22 |
MODEL_PRICING = {
|
| 23 |
"google/gemini-2.0-flash-001": "$0.03",
|
|
@@ -177,7 +182,7 @@ def create_demo():
|
|
| 177 |
text = f"""**Current Model**: Gemini 2.0 Flash (cheap)
|
| 178 |
**Estimated cost per 100 Images**: {MODEL_PRICING["google/gemini-2.0-flash-001"]}"""
|
| 179 |
|
| 180 |
-
return gr.Update(choices=
|
| 181 |
else:
|
| 182 |
all_models_list = preferred_models
|
| 183 |
|
|
|
|
| 18 |
|
| 19 |
OR = OpenRouterAPI()
|
| 20 |
|
| 21 |
+
# Get authorized users from environment variable/secret
|
| 22 |
+
authorized_users_str = os.environ.get("AUTHORIZED_USER_IDS", "")
|
| 23 |
+
AUTHORIZED_USER_IDS = set(authorized_users_str.split(',') if authorized_users_str and authorized_users_str.strip() else [])
|
| 24 |
+
|
| 25 |
+
|
| 26 |
# Define model pricing information (approximate costs per 100 image API calls)
|
| 27 |
MODEL_PRICING = {
|
| 28 |
"google/gemini-2.0-flash-001": "$0.03",
|
|
|
|
| 182 |
text = f"""**Current Model**: Gemini 2.0 Flash (cheap)
|
| 183 |
**Estimated cost per 100 Images**: {MODEL_PRICING["google/gemini-2.0-flash-001"]}"""
|
| 184 |
|
| 185 |
+
return gr.Update(choices=preferred_models_auth, label="Select Model",value="google/gemini-2.0-flash-001"),False,text
|
| 186 |
else:
|
| 187 |
all_models_list = preferred_models
|
| 188 |
|