Commit
•
9bebf7e
1
Parent(s):
9b99dad
✨ Link to hf.co/chat from logo (#94)
Browse files
.env
CHANGED
@@ -4,9 +4,9 @@
|
|
4 |
MONGODB_URL=#your mongodb URL here
|
5 |
MONGODB_DB_NAME=chat-ui
|
6 |
HF_TOKEN=#your huggingface token here
|
7 |
-
SHARE_BASE_URL=#https://hf.co/chat
|
8 |
COOKIE_NAME=hf-chat
|
9 |
|
|
|
10 |
PUBLIC_MODEL_ENDPOINT=https://api-inference.huggingface.co/models/OpenAssistant/oasst-sft-6-llama-30b
|
11 |
PUBLIC_MODEL_NAME=OpenAssistant/oasst-sft-6-llama-30b # public facing link
|
12 |
PUBLIC_MODEL_ID=OpenAssistant/oasst-sft-6-llama-30b-xor # used to link to model page
|
|
|
4 |
MONGODB_URL=#your mongodb URL here
|
5 |
MONGODB_DB_NAME=chat-ui
|
6 |
HF_TOKEN=#your huggingface token here
|
|
|
7 |
COOKIE_NAME=hf-chat
|
8 |
|
9 |
+
PUBLIC_ORIGIN=#https://hf.co
|
10 |
PUBLIC_MODEL_ENDPOINT=https://api-inference.huggingface.co/models/OpenAssistant/oasst-sft-6-llama-30b
|
11 |
PUBLIC_MODEL_NAME=OpenAssistant/oasst-sft-6-llama-30b # public facing link
|
12 |
PUBLIC_MODEL_ID=OpenAssistant/oasst-sft-6-llama-30b-xor # used to link to model page
|
src/lib/components/NavMenu.svelte
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
import CarbonTrashCan from "~icons/carbon/trash-can";
|
8 |
import CarbonExport from "~icons/carbon/export";
|
9 |
import { switchTheme } from "$lib/switchTheme";
|
|
|
10 |
|
11 |
const dispatch = createEventDispatcher<{
|
12 |
shareConversation: { id: string; title: string };
|
@@ -20,10 +21,10 @@
|
|
20 |
</script>
|
21 |
|
22 |
<div class="flex-none max-sm:pt-0 sticky top-0 px-3 py-3.5 flex items-center justify-between">
|
23 |
-
<
|
24 |
<Logo classNames="mr-1 text-3xl" />
|
25 |
HuggingChat
|
26 |
-
</
|
27 |
<a
|
28 |
href={base || "/"}
|
29 |
class="flex border py-0.5 px-2 rounded-lg shadow-sm hover:shadow-none bg-white dark:bg-gray-700 dark:border-gray-600 text-center"
|
|
|
7 |
import CarbonTrashCan from "~icons/carbon/trash-can";
|
8 |
import CarbonExport from "~icons/carbon/export";
|
9 |
import { switchTheme } from "$lib/switchTheme";
|
10 |
+
import { PUBLIC_ORIGIN } from "$env/static/public";
|
11 |
|
12 |
const dispatch = createEventDispatcher<{
|
13 |
shareConversation: { id: string; title: string };
|
|
|
21 |
</script>
|
22 |
|
23 |
<div class="flex-none max-sm:pt-0 sticky top-0 px-3 py-3.5 flex items-center justify-between">
|
24 |
+
<a class="rounded-xl font-semibold text-lg flex items-center" href="{PUBLIC_ORIGIN}{base}/">
|
25 |
<Logo classNames="mr-1 text-3xl" />
|
26 |
HuggingChat
|
27 |
+
</a>
|
28 |
<a
|
29 |
href={base || "/"}
|
30 |
class="flex border py-0.5 px-2 rounded-lg shadow-sm hover:shadow-none bg-white dark:bg-gray-700 dark:border-gray-600 text-center"
|
src/routes/conversation/[id]/share/+server.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import { base } from "$app/paths";
|
2 |
-
import {
|
3 |
import { collections } from "$lib/server/database.js";
|
4 |
import type { SharedConversation } from "$lib/types/SharedConversation.js";
|
5 |
import { sha256 } from "$lib/utils/sha256.js";
|
@@ -24,7 +24,7 @@ export async function POST({ params, url, locals }) {
|
|
24 |
if (existingShare) {
|
25 |
return new Response(
|
26 |
JSON.stringify({
|
27 |
-
url: (
|
28 |
}),
|
29 |
{ headers: { "Content-Type": "application/json" } }
|
30 |
);
|
@@ -43,7 +43,7 @@ export async function POST({ params, url, locals }) {
|
|
43 |
|
44 |
return new Response(
|
45 |
JSON.stringify({
|
46 |
-
url:
|
47 |
}),
|
48 |
{ headers: { "Content-Type": "application/json" } }
|
49 |
);
|
|
|
1 |
import { base } from "$app/paths";
|
2 |
+
import { PUBLIC_ORIGIN } from "$env/static/private";
|
3 |
import { collections } from "$lib/server/database.js";
|
4 |
import type { SharedConversation } from "$lib/types/SharedConversation.js";
|
5 |
import { sha256 } from "$lib/utils/sha256.js";
|
|
|
24 |
if (existingShare) {
|
25 |
return new Response(
|
26 |
JSON.stringify({
|
27 |
+
url: (PUBLIC_ORIGIN || `${url.origin}${base}`) + `/r/${existingShare._id}`,
|
28 |
}),
|
29 |
{ headers: { "Content-Type": "application/json" } }
|
30 |
);
|
|
|
43 |
|
44 |
return new Response(
|
45 |
JSON.stringify({
|
46 |
+
url: `${PUBLIC_ORIGIN || url.origin}${base}/r/${shared._id}`,
|
47 |
}),
|
48 |
{ headers: { "Content-Type": "application/json" } }
|
49 |
);
|