-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_utils.py
77 lines (76 loc) · 2.26 KB
/
app_utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
template = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Query Result</title>
<style>
body { font-family: Arial, sans-serif; }
.content {
margin-bottom: 20px;}
.content p { font-size: 16px; }
.images-grid {
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: center;
}
.images-grid img {
width: calc(50% - 10px);
height: auto;
object-fit: contain;
margin-bottom: 10px;
border-radius: 4px;
background-color: #000;
}
.references {
margin-top: 20px;
}
.references h2 {
margin-bottom: 10px;
}
.references ul {
list-style-type: none;
padding: 0;
}
.references li a {
text-decoration: none;
color: #0645AD;
}
.references li a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="content">
<h2>Content</h2>
<p>{{ content }}</p>
</div>
{% if images %}
<div class="images">
<h2>Images Results</h2>
<div class="images-grid">
{% for image in images %}
<img src="{{ image }}" alt="Image">
{% endfor %}
</div>
</div>
{% endif %}
{% if references %}
<div class="references">
<h2>References</h2>
<ul>
{% for reference in references %}
<li><a href="{{ reference }}" target="_blank">{{ reference }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
</body>
</html>
"""
desc = '''
<p style="font-size:20px;">Explore the cutting-edge capabilities of our intelligent open-source agent, powered by the Zephyr-7B-beta model. This interactive demo showcases our system's proficiency in processing and analyzing factual information across the web, utilizing advanced techniques like Retriever-Augmented Generation, keyword extraction, and intelligent web page segmentation. Experience firsthand how our tool delivers personalized, accurate, and efficient assistance in real-time.</p>
'''