Please create or update the file at pages/api/generate-slides.js with the following code: js Copy Edit import { InferenceClient } from "huggingface_hub"; export default async function handler(req, res) { const client = new InferenceClient({ provider: "hyperbolic", apiKey: process.env.HF_TOKEN, }); const text = req.body.text; try { const completion = await client.chat.completions.create({ model: "deepseek-ai/DeepSeek-V2.5", messages: [ { role: "system", content: "You convert text into slides with titles and bullets." }, { role: "user", content: text }, ], }); const slides = completion.choices[0].message.content; res.status(200).json({ slides }); } catch (error) { console.error("Hugging Face API error:", error); res.status(500).json({ error: "Failed to generate slides from text" }); } } Also ensure the .env.local file contains the Hugging Face token as HF_TOKEN=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, and that this file is NOT exposed publicly. This endpoint will receive the extracted text from uploaded files and return AI-generated slides - Initial Deployment
6a75821 verified |
Download README.md from nedrzbb/deckly: direct link, hf CLI and curl.
- Browser
- Download file 207 Bytes
-
https://huggingface.co/spaces/nedrzbb/deckly/resolve/main/README.md
- Command line
-
hf download hf://spaces/nedrzbb/deckly/README.md
-
curl -L -o README.md https://huggingface.co/spaces/nedrzbb/deckly/resolve/main/README.md
207 Bytes
metadata
title: deckly
emoji: 🐳
colorFrom: red
colorTo: purple
sdk: static
pinned: false
tags:
- deepsite
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference