Commit
·
58e0b0e
1
Parent(s):
e0ae8d4
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import openai
|
| 3 |
-
from api_usage import
|
| 4 |
|
| 5 |
def get_key_info(key):
|
| 6 |
# Return a dictionary containing key information
|
|
@@ -11,17 +11,16 @@ def get_key_info(key):
|
|
| 11 |
"gpt4_availability": "",
|
| 12 |
"gpt4_32k_availability": "",
|
| 13 |
"requests_per_minute": "",
|
|
|
|
| 14 |
"organization": "",
|
| 15 |
"quota": ""}
|
| 16 |
if key_avai:
|
| 17 |
info = get_subscription(key)
|
| 18 |
-
# used = get_usage(key)
|
| 19 |
-
gpt4_avai = check_gpt4_availability()
|
| 20 |
-
gpt4_32k_avai = check_gpt4_32k_availability()
|
| 21 |
# info_dict["account_name"] = info["account_name"]
|
| 22 |
-
info_dict["gpt4_availability"] =
|
| 23 |
-
info_dict["gpt4_32k_availability"] =
|
| 24 |
-
info_dict["requests_per_minute"] = info["rpm"]
|
|
|
|
| 25 |
info_dict["organization"] = info["organization"]
|
| 26 |
info_dict["quota"] = info["quota"]
|
| 27 |
return info_dict
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import openai
|
| 3 |
+
from api_usage import get_subscription, check_key_availability #, get_usage, check_gpt4_availability, check_gpt4_32k_availability,
|
| 4 |
|
| 5 |
def get_key_info(key):
|
| 6 |
# Return a dictionary containing key information
|
|
|
|
| 11 |
"gpt4_availability": "",
|
| 12 |
"gpt4_32k_availability": "",
|
| 13 |
"requests_per_minute": "",
|
| 14 |
+
"tokens_per_minute": "",
|
| 15 |
"organization": "",
|
| 16 |
"quota": ""}
|
| 17 |
if key_avai:
|
| 18 |
info = get_subscription(key)
|
|
|
|
|
|
|
|
|
|
| 19 |
# info_dict["account_name"] = info["account_name"]
|
| 20 |
+
info_dict["gpt4_availability"] = info["has_gpt4"]
|
| 21 |
+
info_dict["gpt4_32k_availability"] = info["has_gpt4_32k"]
|
| 22 |
+
info_dict["requests_per_minute"] = info["rpm"]
|
| 23 |
+
info_dict["tokens_per_minute"] = info["tpm"]
|
| 24 |
info_dict["organization"] = info["organization"]
|
| 25 |
info_dict["quota"] = info["quota"]
|
| 26 |
return info_dict
|