dwb2023 commited on
Commit
55c3835
1 Parent(s): 06f6fdf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -20,6 +20,8 @@ def format_output(extracted_content, repo_url):
20
  def extract_and_display(url):
21
  hf_token = os.getenv("HF_TOKEN")
22
  hf_user = os.getenv("SPACE_AUTHOR_NAME")
 
 
23
  extracted_content = extract_repo_content(url, hf_token, hf_user)
24
  formatted_output = format_output(extracted_content, url)
25
  return formatted_output
 
20
  def extract_and_display(url):
21
  hf_token = os.getenv("HF_TOKEN")
22
  hf_user = os.getenv("SPACE_AUTHOR_NAME")
23
+ if not hf_token or not hf_user:
24
+ return "Error: HF_TOKEN or SPACE_AUTHOR_NAME environment variable is not set."
25
  extracted_content = extract_repo_content(url, hf_token, hf_user)
26
  formatted_output = format_output(extracted_content, url)
27
  return formatted_output