Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
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['
|
52 |
card = f"""
|
53 |
<div class="card" id="doc{i}">
|
54 |
<div class="card-content">
|
55 |
-
<h2>Doc {i} - {meta['
|
56 |
<p>{content}</p>
|
57 |
</div>
|
58 |
<div class="card-footer">
|
59 |
<span>{name}</span>
|
60 |
-
<a href="{meta['
|
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,
|