alexkueck commited on
Commit
577903a
·
verified ·
1 Parent(s): 161141a

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +3 -3
utils.py CHANGED
@@ -868,12 +868,12 @@ def transfer_input(inputs):
868
 
869
  ########################################################
870
  ######## Hilfsfunktionen Datei-Upload ##################
871
- """
872
  def download_link(doc):
873
  # URL für das Herunterladen der Datei
874
  # Check if doc is a dictionary and contains the key 'pfad'
875
  if isinstance(doc, dict) and 'pfad' in doc:
876
- file_url = f"https://huggingface.co/spaces/alexkueck/SucheRAG/resolve/main/chroma/kkg/{doc['pfad']}?token=hf_token"
877
  return f'<b><a href="{file_url}" target="_blank" style="color: #BB70FC; font-weight: bold;">{doc["titel"]}</a></b>'
878
  else:
879
  file_url = f"https://huggingface.co/spaces/alexkueck/SucheRAG/resolve/main/{doc}?token=hf_token"
@@ -895,7 +895,7 @@ def download_link(doc):
895
  encoded_doc = quote(doc)
896
  file_url = f"{base_url}/{encoded_doc}?token={hf_token}"
897
  return f'<b><a href="{file_url}" target="_blank" style="color: #BB70FC; font-weight: bold;">{doc}</a></b>'
898
-
899
 
900
 
901
 
 
868
 
869
  ########################################################
870
  ######## Hilfsfunktionen Datei-Upload ##################
871
+
872
  def download_link(doc):
873
  # URL für das Herunterladen der Datei
874
  # Check if doc is a dictionary and contains the key 'pfad'
875
  if isinstance(doc, dict) and 'pfad' in doc:
876
+ file_url = f"https://huggingface.co/spaces/alexkueck/{STORAGE_REPO_ID}/resolve/main/chroma/kkg/{doc['pfad']}?token=hf_token"
877
  return f'<b><a href="{file_url}" target="_blank" style="color: #BB70FC; font-weight: bold;">{doc["titel"]}</a></b>'
878
  else:
879
  file_url = f"https://huggingface.co/spaces/alexkueck/SucheRAG/resolve/main/{doc}?token=hf_token"
 
895
  encoded_doc = quote(doc)
896
  file_url = f"{base_url}/{encoded_doc}?token={hf_token}"
897
  return f'<b><a href="{file_url}" target="_blank" style="color: #BB70FC; font-weight: bold;">{doc}</a></b>'
898
+ """
899
 
900
 
901