Spaces:
Running
Running
oceansweep
commited on
Commit
•
dbe74f6
1
Parent(s):
83730d1
Update app.py
Browse files
app.py
CHANGED
@@ -1487,8 +1487,9 @@ def main(input_path, api_name=None, api_key=None, num_speakers=2, whisper_model=
|
|
1487 |
except requests.exceptions.ConnectionError:
|
1488 |
requests.status_code = "Connection: "
|
1489 |
elif api_name.lower() == "huggingface":
|
1490 |
-
|
1491 |
-
|
|
|
1492 |
try:
|
1493 |
logging.debug(f"MAIN: Trying to summarize with huggingface")
|
1494 |
summarize_with_huggingface(huggingface_api_key, json_file_path, custom_prompt)
|
|
|
1487 |
except requests.exceptions.ConnectionError:
|
1488 |
requests.status_code = "Connection: "
|
1489 |
elif api_name.lower() == "huggingface":
|
1490 |
+
huggingface_api_key = os.environ.get(HF_TOKEN)
|
1491 |
+
if huggingface_api_key is = None:
|
1492 |
+
huggingface_api_key = api_key if api_key else config.get('API', 'huggingface_api_key', fallback=None)
|
1493 |
try:
|
1494 |
logging.debug(f"MAIN: Trying to summarize with huggingface")
|
1495 |
summarize_with_huggingface(huggingface_api_key, json_file_path, custom_prompt)
|