Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -107,36 +107,22 @@ def make_html_source(source,i):
|
|
107 |
# content = source.page_content.split(":",1)[1].strip()
|
108 |
content = source.page_content.strip()
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
if meta["chunk_type"] == "text":
|
125 |
-
|
126 |
-
card = f"""
|
127 |
-
<div class="card" id="doc{i}">
|
128 |
-
<div class="card-content">
|
129 |
-
<h2>Doc {i} - {meta['short_name']} - Page {int(meta['page_number'])}</h2>
|
130 |
-
<p>{content}</p>
|
131 |
</div>
|
132 |
-
|
133 |
-
|
134 |
-
<a href="{meta['url']}#page={int(meta['page_number'])}" target="_blank" class="pdf-link">
|
135 |
-
<span role="img" aria-label="Open PDF">🔗</span>
|
136 |
-
</a>
|
137 |
-
</div>
|
138 |
-
</div>
|
139 |
-
"""
|
140 |
return card
|
141 |
# --------------------------------------------------------------------
|
142 |
# Gradio
|
|
|
107 |
# content = source.page_content.split(":",1)[1].strip()
|
108 |
content = source.page_content.strip()
|
109 |
|
110 |
+
name = meta['source']
|
111 |
+
card = f"""
|
112 |
+
<div class="card" id="doc{i}">
|
113 |
+
<div class="card-content">
|
114 |
+
<h2>Doc {i} - {meta['file_path']} - Page {int(meta['page'])}</h2>
|
115 |
+
<p>{content}</p>
|
116 |
+
</div>
|
117 |
+
<div class="card-footer">
|
118 |
+
<span>{name}</span>
|
119 |
+
<a href="{meta['file_path']}#page={int(meta['page'])}" target="_blank" class="pdf-link">
|
120 |
+
<span role="img" aria-label="Open PDF">🔗</span>
|
121 |
+
</a>
|
122 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
</div>
|
124 |
+
"""
|
125 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
return card
|
127 |
# --------------------------------------------------------------------
|
128 |
# Gradio
|