Skip to content

Commit 57e1282

Browse files
authored
link to chat (#19)
* link to chat * fix env var link
1 parent 4840b94 commit 57e1282

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

frontend/src/components/ui/ModelCard.svelte

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
};
1616
}
1717
export let entry: ModelCardProps["entry"];
18-
19-
// Get the logo URL for this model
18+
export let chatAppUrl: string;
19+
2020
const logoUrl = getModelLogo(entry.data.title);
2121
const metricsUrl = getModelMetricsUrl(entry.data.title);
2222
const tier = getModelTier(entry.data.title);
23+
const chatUrl = `${chatAppUrl.replace(/\/$/, "")}/?models=${encodeURIComponent(entry.data.title)}`;
2324
2425
let copied = false;
2526
@@ -39,7 +40,9 @@
3940
</script>
4041

4142
<a
42-
href=https://huggingface.co/{entry.data.title}
43+
href={chatUrl}
44+
target="_blank"
45+
rel="noopener noreferrer"
4346
class="relative group flex flex-nowrap py-3 px-4 pr-10 rounded-lg border border-black/15 dark:border-white/20 hover:bg-black/5 dark:hover:bg-white/5 hover:text-black dark:hover:text-white transition-colors duration-300 ease-in-out"
4447
>
4548
<div class="flex items-center gap-3 min-w-0">
@@ -171,6 +174,7 @@ class="relative group flex flex-nowrap py-3 px-4 pr-10 rounded-lg border border-
171174
cursor: help;
172175
}
173176
177+
174178
@keyframes check-bounce {
175179
0% {
176180
transform: scale(1);

frontend/src/components/ui/ModelList.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import { getApiUrl } from "../../lib/config";
55
import { getModelTier } from "../../lib/modelMetrics";
66
7+
export let chatAppUrl;
8+
79
let models = [];
810
let modelCount = 0;
911
let loading = true;
@@ -116,7 +118,7 @@
116118
{:else}
117119
<div class="model-list space-y-2">
118120
{#each filteredModels as model (model.data.title)}
119-
<ModelCard entry={model} />
121+
<ModelCard entry={model} {chatAppUrl} />
120122
{/each}
121123
{#if filteredModels.length === 0}
122124
<div class="text-center text-slate-500 dark:text-slate-400 py-6">

frontend/src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ const sponsors = [
173173
<!-- Available Models Section -->
174174
<section class="animate space-y-8">
175175
<div class="card p-8">
176-
<ModelList client:load />
176+
<ModelList client:load chatAppUrl={chatAppUrl} />
177177
</div>
178178
</section>
179179

0 commit comments

Comments
 (0)