Update utils.py
Browse files
utils.py
CHANGED
@@ -795,9 +795,9 @@ def extract_document_info(documents):
|
|
795 |
# Determine the document type and adjust the path accordingly
|
796 |
doc_path = doc.metadata.get("path", "")
|
797 |
if doc_path.endswith('.pdf'):
|
798 |
-
download_link = f"https://huggingface.co/spaces/alexkueck/
|
799 |
elif doc_path.endswith('.docx'):
|
800 |
-
download_link = f"https://huggingface.co/spaces/alexkueck/
|
801 |
else:
|
802 |
download_link = doc_path
|
803 |
|
@@ -868,7 +868,7 @@ 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'
|
@@ -878,7 +878,7 @@ def download_link(doc):
|
|
878 |
else:
|
879 |
file_url = f"https://huggingface.co/spaces/alexkueck/{STORAGE_REPO_ID}/resolve/main/{doc}?token=hf_token"
|
880 |
return f'<b><a href="{file_url}" target="_blank" style="color: #BB70FC; font-weight: bold;">{doc}</a></b>'
|
881 |
-
|
882 |
|
883 |
def download_link(doc):
|
884 |
# Basis-URL für das Hugging Face Repository
|
|
|
795 |
# Determine the document type and adjust the path accordingly
|
796 |
doc_path = doc.metadata.get("path", "")
|
797 |
if doc_path.endswith('.pdf'):
|
798 |
+
download_link = f"https://huggingface.co/spaces/alexkueck/{STORAGE_REPO_ID}/resolve/main/chroma/kkg/pdf/{title}"
|
799 |
elif doc_path.endswith('.docx'):
|
800 |
+
download_link = f"https://huggingface.co/spaces/alexkueck/{STORAGE_REPO_ID}/resolve/main/chroma/kkg/word/{title}"
|
801 |
else:
|
802 |
download_link = doc_path
|
803 |
|
|
|
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'
|
|
|
878 |
else:
|
879 |
file_url = f"https://huggingface.co/spaces/alexkueck/{STORAGE_REPO_ID}/resolve/main/{doc}?token=hf_token"
|
880 |
return f'<b><a href="{file_url}" target="_blank" style="color: #BB70FC; font-weight: bold;">{doc}</a></b>'
|
881 |
+
|
882 |
|
883 |
def download_link(doc):
|
884 |
# Basis-URL für das Hugging Face Repository
|