Spaces:
Runtime error
Runtime error
Fix env var usage
Browse files
src/routes/+page.server.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
import type { ModelEntryWithTokenizer } from '$lib/types';
|
| 2 |
import type { ModelEntry } from '@huggingface/hub';
|
| 3 |
import type { PageServerLoad } from './$types';
|
|
|
|
| 4 |
|
| 5 |
export const load: PageServerLoad = async ({ fetch }) => {
|
| 6 |
const apiUrl =
|
| 7 |
'https://huggingface.co/api/models?pipeline_tag=text-generation&inference=Warm&filter=conversational';
|
| 8 |
-
const HF_TOKEN =
|
| 9 |
|
| 10 |
const res = await fetch(apiUrl, {
|
| 11 |
headers: {
|
|
|
|
| 1 |
import type { ModelEntryWithTokenizer } from '$lib/types';
|
| 2 |
import type { ModelEntry } from '@huggingface/hub';
|
| 3 |
import type { PageServerLoad } from './$types';
|
| 4 |
+
import { env } from '$env/dynamic/private';
|
| 5 |
|
| 6 |
export const load: PageServerLoad = async ({ fetch }) => {
|
| 7 |
const apiUrl =
|
| 8 |
'https://huggingface.co/api/models?pipeline_tag=text-generation&inference=Warm&filter=conversational';
|
| 9 |
+
const HF_TOKEN = env.HF_TOKEN;
|
| 10 |
|
| 11 |
const res = await fetch(apiUrl, {
|
| 12 |
headers: {
|