:lipstick: make logo bigger and more prominent, conclude with some calls to action.
Browse files
app.py
CHANGED
@@ -49,8 +49,6 @@ def respond(message, history, model):
|
|
49 |
partial_message += escaped_content
|
50 |
yield partial_message
|
51 |
|
52 |
-
logo = open('./logo.svg').read()
|
53 |
-
|
54 |
with open('./model-cache.json', 'r') as f_model_cache:
|
55 |
model_cache = json.load(f_model_cache)
|
56 |
model_class_from_model_id = { model_id: model_class for model_class, model_ids in model_cache.items() for model_id in model_ids }
|
@@ -116,6 +114,8 @@ def initial_model(referer=None):
|
|
116 |
# o = random.Random(f"{key}-{datetime.date.today().strftime('%Y-%m-%d')}")
|
117 |
# return o.choice(model_choices)[1]
|
118 |
|
|
|
|
|
119 |
title_text="HuggingFace's missing inference widget"
|
120 |
css = """
|
121 |
.logo-mark { fill: #ffe184; }
|
@@ -124,17 +124,32 @@ css = """
|
|
124 |
* necessary as putting ChatInterface in gr.Blocks changes behaviour
|
125 |
*/
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
.contain { display: flex; flex-direction: column; }
|
128 |
.gradio-container { height: 100vh !important; }
|
129 |
#component-0 { height: 100%; }
|
130 |
#chatbot { flex-grow: 1; overflow: auto;}
|
131 |
"""
|
|
|
132 |
with gr.Blocks(title_text, css=css) as demo:
|
133 |
-
gr.HTML("""
|
134 |
-
<
|
135 |
-
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
138 |
""")
|
139 |
|
140 |
# hidden_state = gr.State(value=initial_model)
|
@@ -163,10 +178,22 @@ with gr.Blocks(title_text, css=css) as demo:
|
|
163 |
""",
|
164 |
concurrency_limit=5
|
165 |
)
|
|
|
|
|
|
|
|
|
|
|
166 |
gr.HTML(f"""
|
167 |
-
<
|
168 |
-
|
169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
""")
|
171 |
def update_initial_model_choice(request: gr.Request):
|
172 |
return initial_model(request.headers.get('referer'))
|
|
|
49 |
partial_message += escaped_content
|
50 |
yield partial_message
|
51 |
|
|
|
|
|
52 |
with open('./model-cache.json', 'r') as f_model_cache:
|
53 |
model_cache = json.load(f_model_cache)
|
54 |
model_class_from_model_id = { model_id: model_class for model_class, model_ids in model_cache.items() for model_id in model_ids }
|
|
|
114 |
# o = random.Random(f"{key}-{datetime.date.today().strftime('%Y-%m-%d')}")
|
115 |
# return o.choice(model_choices)[1]
|
116 |
|
117 |
+
logo = open('./logo.svg').read()
|
118 |
+
logo_small = open('./logo-small.svg').read()
|
119 |
title_text="HuggingFace's missing inference widget"
|
120 |
css = """
|
121 |
.logo-mark { fill: #ffe184; }
|
|
|
124 |
* necessary as putting ChatInterface in gr.Blocks changes behaviour
|
125 |
*/
|
126 |
|
127 |
+
.row {
|
128 |
+
display: flex;
|
129 |
+
justify-content: center;
|
130 |
+
}
|
131 |
+
|
132 |
+
.footer p {
|
133 |
+
width: 450px;
|
134 |
+
}
|
135 |
+
|
136 |
.contain { display: flex; flex-direction: column; }
|
137 |
.gradio-container { height: 100vh !important; }
|
138 |
#component-0 { height: 100%; }
|
139 |
#chatbot { flex-grow: 1; overflow: auto;}
|
140 |
"""
|
141 |
+
|
142 |
with gr.Blocks(title_text, css=css) as demo:
|
143 |
+
gr.HTML(f"""
|
144 |
+
<div class="header">
|
145 |
+
<h1 class="row">HuggingFace's missing inference widget</h1>
|
146 |
+
<h3 class="row">powered by</h3>
|
147 |
+
<div class="row">
|
148 |
+
<a href="https://featherless.ai">
|
149 |
+
{logo}
|
150 |
+
</a>
|
151 |
+
</div>
|
152 |
+
</div>
|
153 |
""")
|
154 |
|
155 |
# hidden_state = gr.State(value=initial_model)
|
|
|
178 |
""",
|
179 |
concurrency_limit=5
|
180 |
)
|
181 |
+
|
182 |
+
logo_small_no_text = open('./logo-small-no-text.svg').read()
|
183 |
+
x_logo = open('./x-logo.svg').read()
|
184 |
+
discord_logo = open('./discord-logo.svg').read()
|
185 |
+
|
186 |
gr.HTML(f"""
|
187 |
+
<div class="footer">
|
188 |
+
<div class="row">
|
189 |
+
If you enjoyed this space,
|
190 |
+
check out <a href="https://featherless.ai">featherless.ai</a>,
|
191 |
+
and follow us <a href="https://x.com/featherless.ai">on twitter</a>!
|
192 |
+
</div>
|
193 |
+
<!-- <div class="row">If you enjoyed this space,</div>
|
194 |
+
<div class="row">check out <a href="https://featherless.ai">featherless.ai</a>,</div>
|
195 |
+
<div class="row">and follow us <a href="https://x.com/featherless.ai">on twitter</a>!</div> -->
|
196 |
+
</div>
|
197 |
""")
|
198 |
def update_initial_model_choice(request: gr.Request):
|
199 |
return initial_model(request.headers.get('referer'))
|
logo.svg
CHANGED