ppsingh commited on
Commit
f1389fc
1 Parent(s): fe15861

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -48,16 +48,16 @@ def make_html_source(source,i):
48
  # content = source.page_content.split(":",1)[1].strip()
49
  content = source.page_content.strip()
50
 
51
- name = meta['source']
52
  card = f"""
53
  <div class="card" id="doc{i}">
54
  <div class="card-content">
55
- <h2>Doc {i} - {meta['file_path']} - Page {int(meta['page'])}</h2>
56
  <p>{content}</p>
57
  </div>
58
  <div class="card-footer">
59
  <span>{name}</span>
60
- <a href="{meta['file_path']}#page={int(meta['page'])}" target="_blank" class="pdf-link">
61
  <span role="img" aria-label="Open PDF">🔗</span>
62
  </a>
63
  </div>
@@ -183,7 +183,7 @@ async def chat(query,history,sources,reports,subtype,year):
183
  ###-----------------getting inference endpoints------------------------------
184
  llm_qa = HuggingFaceEndpoint(
185
  endpoint_url="https://nhe9phsr2zhs0e36.eu-west-1.aws.endpoints.huggingface.cloud",
186
- max_new_tokens=512,
187
  top_k=10,
188
  top_p=0.95,
189
  typical_p=0.95,
 
48
  # content = source.page_content.split(":",1)[1].strip()
49
  content = source.page_content.strip()
50
 
51
+ name = meta['filename']
52
  card = f"""
53
  <div class="card" id="doc{i}">
54
  <div class="card-content">
55
+ <h2>Doc {i} - {meta['filename']} - Page {int(meta['page'])}</h2>
56
  <p>{content}</p>
57
  </div>
58
  <div class="card-footer">
59
  <span>{name}</span>
60
+ <a href="{meta['filename']}#page={int(meta['page'])}" target="_blank" class="pdf-link">
61
  <span role="img" aria-label="Open PDF">🔗</span>
62
  </a>
63
  </div>
 
183
  ###-----------------getting inference endpoints------------------------------
184
  llm_qa = HuggingFaceEndpoint(
185
  endpoint_url="https://nhe9phsr2zhs0e36.eu-west-1.aws.endpoints.huggingface.cloud",
186
+ max_new_tokens=512*3,
187
  top_k=10,
188
  top_p=0.95,
189
  typical_p=0.95,