Kang Suhyun commited on
Commit
d8b3fa4
1 Parent(s): 740b104

[#21] Fix Firestore auto-reload issue (#83)

Browse files

Gradio 4.23.0 introduced a new feature that prevents execution during auto-reload. This change fixes the existing Firestore reloading issue by upgrading Gradio to 4.23.0.

Files changed (2) hide show
  1. leaderboard.py +3 -3
  2. requirements.txt +2 -2
leaderboard.py CHANGED
@@ -16,9 +16,9 @@ import pandas as pd
16
 
17
  from credentials import get_credentials_json
18
 
19
- # TODO(#21): Fix auto-reload issue related to the initialization of Firebase.
20
- firebase_admin.initialize_app(credentials.Certificate(get_credentials_json()))
21
- db = firestore.client()
22
 
23
  SUPPORTED_TRANSLATION_LANGUAGES = [
24
  language.name.capitalize() for language in lingua.Language.all()
 
16
 
17
  from credentials import get_credentials_json
18
 
19
+ if gr.NO_RELOAD:
20
+ firebase_admin.initialize_app(credentials.Certificate(get_credentials_json()))
21
+ db = firestore.client()
22
 
23
  SUPPORTED_TRANSLATION_LANGUAGES = [
24
  language.name.capitalize() for language in lingua.Language.all()
requirements.txt CHANGED
@@ -37,8 +37,8 @@ google-cloud-storage==2.14.0
37
  google-crc32c==1.5.0
38
  google-resumable-media==2.7.0
39
  googleapis-common-protos==1.62.0
40
- gradio==4.22.0
41
- gradio_client==0.13.0
42
  grpc-google-iam-v1==0.13.0
43
  grpcio==1.60.1
44
  grpcio-status==1.60.1
 
37
  google-crc32c==1.5.0
38
  google-resumable-media==2.7.0
39
  googleapis-common-protos==1.62.0
40
+ gradio==4.23.0
41
+ gradio_client==0.14.0
42
  grpc-google-iam-v1==0.13.0
43
  grpcio==1.60.1
44
  grpcio-status==1.60.1