Daniil commited on
Commit
0aa30de
·
1 Parent(s): 17d7268

Updating json

Browse files
Files changed (3) hide show
  1. pages/FSR_Model.py +18 -24
  2. pages/FS_Model.py +19 -24
  3. pages/_2S_Model.py +18 -25
pages/FSR_Model.py CHANGED
@@ -81,11 +81,25 @@ MODEL_CONFIGS = {
81
  # }
82
  }
83
  PASSCODE = os.environ["MY_PASSCODE"]
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
- # # Authentication check
86
- # if "authenticated" not in st.session_state or not st.session_state["authenticated"]:
87
- # st.error("Access denied. Please go back to the main page and enter the passcode.")
88
- # st.stop()
 
89
 
90
  # Initialize Firebase
91
  if not firebase_admin._apps:
@@ -105,26 +119,6 @@ client = AzureOpenAI(
105
  )
106
 
107
  def authenticate():
108
- creds_dict = {
109
- "type": os.environ.get("FIREBASE_TYPE", "service_account"),
110
- "project_id": os.environ.get("FIREBASE_PROJECT_ID"),
111
- "private_key_id": os.environ.get("FIREBASE_PRIVATE_KEY_ID"),
112
- "private_key": os.environ.get("FIREBASE_PRIVATE_KEY", "").replace("\\n", "\n"),
113
- "client_email": os.environ.get("FIREBASE_CLIENT_EMAIL"),
114
- "client_id": os.environ.get("FIREBASE_CLIENT_ID"),
115
- "auth_uri": os.environ.get("FIREBASE_AUTH_URI", "https://accounts.google.com/o/oauth2/auth"),
116
- "token_uri": os.environ.get("FIREBASE_TOKEN_URI", "https://oauth2.googleapis.com/token"),
117
- "auth_provider_x509_cert_url": os.environ.get("FIREBASE_AUTH_PROVIDER_X509_CERT_URL",
118
- "https://www.googleapis.com/oauth2/v1/certs"),
119
- "client_x509_cert_url": os.environ.get("FIREBASE_CLIENT_X509_CERT_URL"),
120
- "universe_domain": "googleapis.com"
121
-
122
- }
123
- # Create a temporary JSON file
124
- with tempfile.NamedTemporaryFile(suffix='.json', delete=False, mode='w') as temp_file:
125
- json.dump(creds_dict, temp_file)
126
- temp_file.close()
127
-
128
  import uuid
129
 
130
  random_id = uuid.uuid4()
 
81
  # }
82
  }
83
  PASSCODE = os.environ["MY_PASSCODE"]
84
+ creds_dict = {
85
+ "type": os.environ.get("FIREBASE_TYPE", "service_account"),
86
+ "project_id": os.environ.get("FIREBASE_PROJECT_ID"),
87
+ "private_key_id": os.environ.get("FIREBASE_PRIVATE_KEY_ID"),
88
+ "private_key": os.environ.get("FIREBASE_PRIVATE_KEY", "").replace("\\n", "\n"),
89
+ "client_email": os.environ.get("FIREBASE_CLIENT_EMAIL"),
90
+ "client_id": os.environ.get("FIREBASE_CLIENT_ID"),
91
+ "auth_uri": os.environ.get("FIREBASE_AUTH_URI", "https://accounts.google.com/o/oauth2/auth"),
92
+ "token_uri": os.environ.get("FIREBASE_TOKEN_URI", "https://oauth2.googleapis.com/token"),
93
+ "auth_provider_x509_cert_url": os.environ.get("FIREBASE_AUTH_PROVIDER_X509_CERT_URL",
94
+ "https://www.googleapis.com/oauth2/v1/certs"),
95
+ "client_x509_cert_url": os.environ.get("FIREBASE_CLIENT_X509_CERT_URL"),
96
+ "universe_domain": "googleapis.com"
97
 
98
+ }
99
+ # Create a temporary JSON file
100
+ file_path = "coco-evaluation-firebase-adminsdk-p3m64-99c4ea22c1.json"
101
+ with open(file_path, 'w') as json_file:
102
+ json.dump(creds_dict, json_file, indent=2)
103
 
104
  # Initialize Firebase
105
  if not firebase_admin._apps:
 
119
  )
120
 
121
  def authenticate():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  import uuid
123
 
124
  random_id = uuid.uuid4()
pages/FS_Model.py CHANGED
@@ -82,10 +82,25 @@ MODEL_CONFIGS = {
82
  }
83
  PASSCODE = os.environ["MY_PASSCODE"]
84
 
85
- # # Authentication check
86
- # if "authenticated" not in st.session_state or not st.session_state["authenticated"]:
87
- # st.error("Access denied. Please go back to the main page and enter the passcode.")
88
- # st.stop()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
  # Initialize Firebase
91
  if not firebase_admin._apps:
@@ -105,26 +120,6 @@ client = AzureOpenAI(
105
  )
106
 
107
  def authenticate():
108
- creds_dict = {
109
- "type": os.environ.get("FIREBASE_TYPE", "service_account"),
110
- "project_id": os.environ.get("FIREBASE_PROJECT_ID"),
111
- "private_key_id": os.environ.get("FIREBASE_PRIVATE_KEY_ID"),
112
- "private_key": os.environ.get("FIREBASE_PRIVATE_KEY", "").replace("\\n", "\n"),
113
- "client_email": os.environ.get("FIREBASE_CLIENT_EMAIL"),
114
- "client_id": os.environ.get("FIREBASE_CLIENT_ID"),
115
- "auth_uri": os.environ.get("FIREBASE_AUTH_URI", "https://accounts.google.com/o/oauth2/auth"),
116
- "token_uri": os.environ.get("FIREBASE_TOKEN_URI", "https://oauth2.googleapis.com/token"),
117
- "auth_provider_x509_cert_url": os.environ.get("FIREBASE_AUTH_PROVIDER_X509_CERT_URL",
118
- "https://www.googleapis.com/oauth2/v1/certs"),
119
- "client_x509_cert_url": os.environ.get("FIREBASE_CLIENT_X509_CERT_URL"),
120
- "universe_domain": "googleapis.com"
121
-
122
- }
123
- # Create a temporary JSON file
124
- with tempfile.NamedTemporaryFile(suffix='.json', delete=False, mode='w') as temp_file:
125
- json.dump(creds_dict, temp_file)
126
- temp_file.close()
127
-
128
  import uuid
129
 
130
  random_id = uuid.uuid4()
 
82
  }
83
  PASSCODE = os.environ["MY_PASSCODE"]
84
 
85
+ creds_dict = {
86
+ "type": os.environ.get("FIREBASE_TYPE", "service_account"),
87
+ "project_id": os.environ.get("FIREBASE_PROJECT_ID"),
88
+ "private_key_id": os.environ.get("FIREBASE_PRIVATE_KEY_ID"),
89
+ "private_key": os.environ.get("FIREBASE_PRIVATE_KEY", "").replace("\\n", "\n"),
90
+ "client_email": os.environ.get("FIREBASE_CLIENT_EMAIL"),
91
+ "client_id": os.environ.get("FIREBASE_CLIENT_ID"),
92
+ "auth_uri": os.environ.get("FIREBASE_AUTH_URI", "https://accounts.google.com/o/oauth2/auth"),
93
+ "token_uri": os.environ.get("FIREBASE_TOKEN_URI", "https://oauth2.googleapis.com/token"),
94
+ "auth_provider_x509_cert_url": os.environ.get("FIREBASE_AUTH_PROVIDER_X509_CERT_URL",
95
+ "https://www.googleapis.com/oauth2/v1/certs"),
96
+ "client_x509_cert_url": os.environ.get("FIREBASE_CLIENT_X509_CERT_URL"),
97
+ "universe_domain": "googleapis.com"
98
+
99
+ }
100
+ # Create a temporary JSON file
101
+ file_path = "coco-evaluation-firebase-adminsdk-p3m64-99c4ea22c1.json"
102
+ with open(file_path, 'w') as json_file:
103
+ json.dump(creds_dict, json_file, indent=2)
104
 
105
  # Initialize Firebase
106
  if not firebase_admin._apps:
 
120
  )
121
 
122
  def authenticate():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  import uuid
124
 
125
  random_id = uuid.uuid4()
pages/_2S_Model.py CHANGED
@@ -81,11 +81,25 @@ MODEL_CONFIGS = {
81
  # }
82
  }
83
  PASSCODE = os.environ["MY_PASSCODE"]
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
- # # Authentication check
86
- # if "authenticated" not in st.session_state or not st.session_state["authenticated"]:
87
- # st.error("Access denied. Please go back to the main page and enter the passcode.")
88
- # st.stop()
 
89
 
90
  # Initialize Firebase
91
  if not firebase_admin._apps:
@@ -105,28 +119,7 @@ client = AzureOpenAI(
105
  )
106
 
107
  def authenticate():
108
- creds_dict = {
109
- "type": os.environ.get("FIREBASE_TYPE", "service_account"),
110
- "project_id": os.environ.get("FIREBASE_PROJECT_ID"),
111
- "private_key_id": os.environ.get("FIREBASE_PRIVATE_KEY_ID"),
112
- "private_key": os.environ.get("FIREBASE_PRIVATE_KEY", "").replace("\\n", "\n"),
113
- "client_email": os.environ.get("FIREBASE_CLIENT_EMAIL"),
114
- "client_id": os.environ.get("FIREBASE_CLIENT_ID"),
115
- "auth_uri": os.environ.get("FIREBASE_AUTH_URI", "https://accounts.google.com/o/oauth2/auth"),
116
- "token_uri": os.environ.get("FIREBASE_TOKEN_URI", "https://oauth2.googleapis.com/token"),
117
- "auth_provider_x509_cert_url": os.environ.get("FIREBASE_AUTH_PROVIDER_X509_CERT_URL",
118
- "https://www.googleapis.com/oauth2/v1/certs"),
119
- "client_x509_cert_url": os.environ.get("FIREBASE_CLIENT_X509_CERT_URL"),
120
- "universe_domain": "googleapis.com"
121
-
122
- }
123
- # Create a temporary JSON file
124
- with tempfile.NamedTemporaryFile(suffix='.json', delete=False, mode='w') as temp_file:
125
- json.dump(creds_dict, temp_file)
126
- temp_file.close()
127
-
128
  import uuid
129
-
130
 
131
  random_id = uuid.uuid4()
132
  random_id_string = str(random_id)
 
81
  # }
82
  }
83
  PASSCODE = os.environ["MY_PASSCODE"]
84
+ creds_dict = {
85
+ "type": os.environ.get("FIREBASE_TYPE", "service_account"),
86
+ "project_id": os.environ.get("FIREBASE_PROJECT_ID"),
87
+ "private_key_id": os.environ.get("FIREBASE_PRIVATE_KEY_ID"),
88
+ "private_key": os.environ.get("FIREBASE_PRIVATE_KEY", "").replace("\\n", "\n"),
89
+ "client_email": os.environ.get("FIREBASE_CLIENT_EMAIL"),
90
+ "client_id": os.environ.get("FIREBASE_CLIENT_ID"),
91
+ "auth_uri": os.environ.get("FIREBASE_AUTH_URI", "https://accounts.google.com/o/oauth2/auth"),
92
+ "token_uri": os.environ.get("FIREBASE_TOKEN_URI", "https://oauth2.googleapis.com/token"),
93
+ "auth_provider_x509_cert_url": os.environ.get("FIREBASE_AUTH_PROVIDER_X509_CERT_URL",
94
+ "https://www.googleapis.com/oauth2/v1/certs"),
95
+ "client_x509_cert_url": os.environ.get("FIREBASE_CLIENT_X509_CERT_URL"),
96
+ "universe_domain": "googleapis.com"
97
 
98
+ }
99
+ # Create a temporary JSON file
100
+ file_path = "coco-evaluation-firebase-adminsdk-p3m64-99c4ea22c1.json"
101
+ with open(file_path, 'w') as json_file:
102
+ json.dump(creds_dict, json_file, indent=2)
103
 
104
  # Initialize Firebase
105
  if not firebase_admin._apps:
 
119
  )
120
 
121
  def authenticate():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  import uuid
 
123
 
124
  random_id = uuid.uuid4()
125
  random_id_string = str(random_id)