mishig HF staff commited on
Commit
b6a19b1
·
verified ·
1 Parent(s): be701db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -44,8 +44,8 @@ def search_embeddings(query_text, output_option):
44
  if output_option == "human-friendly":
45
  md = f"Stats:\n\nembedding time: {elapsed_time_embedding:.2f}s\n\nmeilisearch time: {elapsed_time_meilisearch:.2f}s\n\n---\n\n"
46
  for hit in hits:
47
- text, source, library = hit["text"], hit["source"], hit["library"]
48
- source = f"[source](https://huggingface.co/docs/{library}/{source})"
49
  md += text + f"\n\n{source}\n\n---\n\n"
50
  return md
51
  elif output_option == "RAG-friendly":
 
44
  if output_option == "human-friendly":
45
  md = f"Stats:\n\nembedding time: {elapsed_time_embedding:.2f}s\n\nmeilisearch time: {elapsed_time_meilisearch:.2f}s\n\n---\n\n"
46
  for hit in hits:
47
+ text, source_page_url, source_page_title, library = hit["text"], hit["source_page_url"], hit["source_page_title"], hit["library"]
48
+ source = f"src: ["{source_page_title}"]({source_page_url})"
49
  md += text + f"\n\n{source}\n\n---\n\n"
50
  return md
51
  elif output_option == "RAG-friendly":