marinone94
commited on
Commit
•
d6fb5e8
1
Parent(s):
fd7be5b
get also wandb and email creds from file
Browse files
run_speech_recognition_seq2seq_streaming.py
CHANGED
@@ -63,14 +63,20 @@ logger = logging.getLogger(__name__)
|
|
63 |
|
64 |
wandb_token = os.environ.get("WANDB_TOKEN", "None")
|
65 |
hf_token = os.environ.get("HF_TOKEN", None)
|
66 |
-
if hf_token is None and os.path.exists("./creds.txt"):
|
67 |
with open("./creds.txt", "r") as f:
|
68 |
lines = f.readlines()
|
69 |
for line in lines:
|
70 |
-
key,
|
71 |
if key == "HF_TOKEN":
|
72 |
hf_token = value.strip()
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
if hf_token is not None:
|
75 |
os.makedirs("/root/.huggingface", exist_ok=True)
|
76 |
with open("/root/.huggingface/token", "w") as f:
|
|
|
63 |
|
64 |
wandb_token = os.environ.get("WANDB_TOKEN", "None")
|
65 |
hf_token = os.environ.get("HF_TOKEN", None)
|
66 |
+
if (hf_token is None or wandb_token == "None") and os.path.exists("./creds.txt"):
|
67 |
with open("./creds.txt", "r") as f:
|
68 |
lines = f.readlines()
|
69 |
for line in lines:
|
70 |
+
key, value = line.split("=")
|
71 |
if key == "HF_TOKEN":
|
72 |
hf_token = value.strip()
|
73 |
+
if key == "WANDB_TOKEN":
|
74 |
+
wandb_token = value.strip()
|
75 |
+
if key == "EMAIL_ADDRESS":
|
76 |
+
os.environ["EMAIL_ADDRESS"] = value.strip()
|
77 |
+
if key == "EMAIL_PASSWORD":
|
78 |
+
os.environ["EMAIL_PASSWORD"] = value.strip()
|
79 |
+
|
80 |
if hf_token is not None:
|
81 |
os.makedirs("/root/.huggingface", exist_ok=True)
|
82 |
with open("/root/.huggingface/token", "w") as f:
|