derek-thomas HF staff commited on
Commit
c5200c8
1 Parent(s): 7beacaa

Debugging attempt

Browse files
Files changed (2) hide show
  1. app.py +11 -10
  2. templates/template.j2 +1 -1
app.py CHANGED
@@ -31,16 +31,17 @@ def bot(history, system_prompt=""):
31
  top_k = 5
32
  query = history[-1][0]
33
 
34
- logger.warning('Retrieving documents...')
35
- # Retrieve documents relevant to query
36
- document_start = perf_counter()
37
- documents = qd_retriever.retrieve(query, top_k=top_k)
38
- document_time = document_start - perf_counter()
39
- logger.warning('Finished Retrieving documents...')
40
-
41
- # Create Prompt
42
- prompt = template.render(documents=documents, query=query)
43
- prompt_html = template_html.render(documents=documents, query=query)
 
44
  logger.warning(prompt)
45
 
46
  history[-1][1] = ""
 
31
  top_k = 5
32
  query = history[-1][0]
33
 
34
+ # logger.warning('Retrieving documents...')
35
+ # # Retrieve documents relevant to query
36
+ # document_start = perf_counter()
37
+ # documents = qd_retriever.retrieve(query, top_k=top_k)
38
+ # document_time = document_start - perf_counter()
39
+ # logger.warning('Finished Retrieving documents...')
40
+ #
41
+ # # Create Prompt
42
+ # prompt = template.render(documents=documents, query=query)
43
+ # prompt_html = template_html.render(documents=documents, query=query)
44
+ prompt = query
45
  logger.warning(prompt)
46
 
47
  history[-1][1] = ""
templates/template.j2 CHANGED
@@ -3,6 +3,6 @@ Context:
3
  {% for doc in documents %}
4
  ---
5
  {{ doc.content }}
6
- ---
7
  {% endfor %}
 
8
  Query: {{ query }}
 
3
  {% for doc in documents %}
4
  ---
5
  {{ doc.content }}
 
6
  {% endfor %}
7
+ ---
8
  Query: {{ query }}