Spaces:
Runtime error
Runtime error
Create serve_constants.py
Browse files- serve_constants.py +118 -0
serve_constants.py
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
title_markdown = """
|
2 |
+
<div style="display: flex; justify-content: left; align-items: center; text-align: left; background: linear-gradient(45deg, rgba(195, 253, 245, 0.8), rgba(255, 0, 80, 0.3)); border-radius: 10px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.1);"> <a href="https://llava-vl.github.io/blog/2024-05-10-llava-next-stronger-llms/" style="margin-right: 20px; text-decoration: none; display: flex; align-items: center;">
|
3 |
+
<img src="https://i.postimg.cc/sgbKDRVP/pangea-logo.png" alt="LLaVA-NeXT" style="max-width: 80px; height: auto; border-radius: 10px;">
|
4 |
+
</a>
|
5 |
+
<div>
|
6 |
+
<h2 ><a href="https://llava-vl.github.io/blog/2024-05-10-llava-next-stronger-llms/">LLaVA OneVision: Multimodal Chat</a> </h2>
|
7 |
+
<h5 style="margin: 0;"><a href="https://llavanext-video.lmms-lab.com/">Video Model</a> | <a href="https://github.com/LLaVA-VL/LLaVA-NeXT">Github</a> | <a href="https://huggingface.co/collections/lmms-lab/llava-next-6623288e2d61edba3ddbf5ff">Huggingface</a> | <a href="https://llava-vl.github.io/blog/2024-05-10-llava-next-stronger-llms/">Blog</a> | <a href="https://llava-vl.github.io">More</a></h5>
|
8 |
+
</div>
|
9 |
+
</div>
|
10 |
+
"""
|
11 |
+
|
12 |
+
html_header = """
|
13 |
+
<style>
|
14 |
+
/* Existing Styles for Larger Screens */
|
15 |
+
.header-container {
|
16 |
+
display: flex;
|
17 |
+
justify-content: left;
|
18 |
+
align-items: center;
|
19 |
+
text-align: left;
|
20 |
+
background: linear-gradient(45deg, rgba(195, 253, 245, 1), rgba(255, 0, 80, 0.3));
|
21 |
+
border-radius: 10px;
|
22 |
+
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.1);
|
23 |
+
padding: 10px 20px; /* Added padding */
|
24 |
+
}
|
25 |
+
|
26 |
+
.header-container img {
|
27 |
+
max-width: 80px;
|
28 |
+
height: auto;
|
29 |
+
border-radius: 10px;
|
30 |
+
}
|
31 |
+
|
32 |
+
.header-container a {
|
33 |
+
color: black; /* Ensure text color is always black */
|
34 |
+
text-decoration: none;
|
35 |
+
}
|
36 |
+
|
37 |
+
/* Responsive adjustments for screens less than 768px wide */
|
38 |
+
@media (max-width: 768px) {
|
39 |
+
.header-container {
|
40 |
+
flex-direction: column;
|
41 |
+
align-items: flex-start;
|
42 |
+
padding: 10px 15px; /* Adjust padding for smaller screens */
|
43 |
+
}
|
44 |
+
|
45 |
+
.header-container img {
|
46 |
+
max-width: 60px; /* Adjust image size for smaller screens */
|
47 |
+
}
|
48 |
+
|
49 |
+
.header-container h2, .header-container h5 {
|
50 |
+
color: black; /* Ensure text color is always black */
|
51 |
+
text-decoration: none;
|
52 |
+
text-align: center; /* Center text on small screens */
|
53 |
+
margin-top: 5px; /* Add top margin for better spacing after stacking */
|
54 |
+
}
|
55 |
+
|
56 |
+
.header-container h2 {
|
57 |
+
color: black; /* Ensure text color is always black */
|
58 |
+
text-decoration: none;
|
59 |
+
font-size: 16px; /* Smaller font size for the title on mobile */
|
60 |
+
}
|
61 |
+
|
62 |
+
.header-container h5 {
|
63 |
+
color: black; /* Ensure text color is always black */
|
64 |
+
text-decoration: none;
|
65 |
+
font-size: 12px; /* Smaller font size for the subtitle on mobile */
|
66 |
+
}
|
67 |
+
|
68 |
+
.header-container a {
|
69 |
+
color: black; /* Ensure text color is always black */
|
70 |
+
text-decoration: none;
|
71 |
+
}
|
72 |
+
}
|
73 |
+
</style>
|
74 |
+
|
75 |
+
<div class="header-container">
|
76 |
+
<a href="https://neulab.github.io/Pangea/" style="margin-right: 20px; text-decoration: none; display: flex; align-items: center;">
|
77 |
+
<img src="https://i.postimg.cc/sgbKDRVP/pangea-logo.png" alt="LLaVA-NeXT">
|
78 |
+
</a>
|
79 |
+
<div>
|
80 |
+
<h2><a href="https://neulab.github.io/Pangea/">PANGEA: A Fully Open Multilingual Multimodal LLM for 39 Languages</a></h2>
|
81 |
+
<h5><a href="https://neulab.github.io/Pangea/">Code</a> | <a href="https://neulab.github.io/Pangea/">Checkpoints</a> | <a href="https://neulab.github.io/Pangea/">Data</a> | <a href="https://neulab.github.io/Pangea/">PANGEA Demo</a></h5>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
"""
|
85 |
+
|
86 |
+
block_css = """
|
87 |
+
#buttons button {
|
88 |
+
min-width: min(120px,100%);
|
89 |
+
}
|
90 |
+
"""
|
91 |
+
|
92 |
+
tos_markdown = """
|
93 |
+
## Terms of use
|
94 |
+
By using this service, users are required to agree to the following terms:
|
95 |
+
The service is a research preview intended for non-commercial use only. It only provides limited safety measures and may generate offensive content. It must not be used for any illegal, harmful, violent, racist, or sexual purposes. The service may collect user dialogue data for future research.
|
96 |
+
|
97 |
+
We deploy our model backend with SGLang. However, there could be congestion during the serving process, leading to delayed responses. If you encounter any issues with the webpage, kindly refresh it.
|
98 |
+
"""
|
99 |
+
|
100 |
+
|
101 |
+
learn_more_markdown = """
|
102 |
+
## License
|
103 |
+
The service is a research preview intended for non-commercial use only, subject to the model [License](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md) of LLaMA, [Terms of Use](https://openai.com/policies/terms-of-use) of the data generated by OpenAI, and [Privacy Practices](https://chrome.google.com/webstore/detail/sharegpt-share-your-chatg/daiacboceoaocpibfodeljbdfacokfjb) of ShareGPT. Please contact us if you find any potential violation.
|
104 |
+
"""
|
105 |
+
|
106 |
+
bibtext = """
|
107 |
+
## Citation
|
108 |
+
```
|
109 |
+
```
|
110 |
+
"""
|
111 |
+
|
112 |
+
block_css = """
|
113 |
+
|
114 |
+
#buttons button {
|
115 |
+
min-width: min(120px,100%);
|
116 |
+
}
|
117 |
+
|
118 |
+
"""
|