feat: drop embedded webui (#27)

Signed-off-by: mudler <mudler@c3os.io>
This commit is contained in:
Ettore Di Giacinto 2023-04-16 10:46:20 +02:00 committed by GitHub
parent 63601fabd1
commit 0b330d90ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 148 deletions

View file

@ -1,9 +1,7 @@
package api
import (
"embed"
"fmt"
"net/http"
"strings"
"sync"
@ -12,7 +10,6 @@ import (
llama "github.com/go-skynet/go-llama.cpp"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
"github.com/gofiber/fiber/v2/middleware/filesystem"
"github.com/gofiber/fiber/v2/middleware/recover"
)
@ -65,9 +62,6 @@ type OpenAIRequest struct {
IgnoreEOS bool `json:"ignore_eos"`
}
//go:embed index.html
var indexHTML embed.FS
// https://platform.openai.com/docs/api-reference/completions
func openAIEndpoint(chat bool, loader *model.ModelLoader, threads int, defaultMutex *sync.Mutex, mutexMap *sync.Mutex, mutexes map[string]*sync.Mutex) func(c *fiber.Ctx) error {
return func(c *fiber.Ctx) error {
@ -234,11 +228,6 @@ func Start(loader *model.ModelLoader, listenAddr string, threads int) error {
})
})
app.Use("/", filesystem.New(filesystem.Config{
Root: http.FS(indexHTML),
NotFoundFile: "index.html",
}))
// Start the server
app.Listen(listenAddr)
return nil