Skip to content

Commit 3728552

Browse files
authored
feat: import models via URI (#7245)
* feat: initial hook to install elements directly Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * WIP: ui changes Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Move HF api client to pkg Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Add simple importer for gguf files Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Add opcache Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * wire importers to CLI Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Add omitempty to config fields Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Fix tests Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Add MLX importer Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Small refactors to star to use HF for discovery Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Add tests Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Common preferences Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Add support to bare HF repos Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * feat(importer/llama.cpp): add support for mmproj files Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * add mmproj quants to common preferences Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Fix vlm usage in tokenizer mode with llama.cpp Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 87d0020 commit 3728552

40 files changed

+1979
-703
lines changed

.github/gallery-agent/agent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"slices"
88
"strings"
99

10-
"github.com/go-skynet/LocalAI/.github/gallery-agent/hfapi"
11-
"github.com/mudler/cogito"
10+
hfapi "github.com/mudler/LocalAI/pkg/huggingface-api"
11+
cogito "github.com/mudler/cogito"
1212

1313
"github.com/mudler/cogito/structures"
1414
"github.com/sashabaranov/go-openai/jsonschema"

.github/gallery-agent/go.mod

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/gallery-agent/go.sum

Lines changed: 0 additions & 168 deletions
This file was deleted.

.github/gallery-agent/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strings"
1010
"time"
1111

12-
"github.com/go-skynet/LocalAI/.github/gallery-agent/hfapi"
12+
hfapi "github.com/mudler/LocalAI/pkg/huggingface-api"
1313
)
1414

1515
// ProcessedModelFile represents a processed model file with additional metadata

.github/gallery-agent/tools.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ package main
33
import (
44
"fmt"
55

6-
"github.com/go-skynet/LocalAI/.github/gallery-agent/hfapi"
7-
"github.com/sashabaranov/go-openai"
8-
"github.com/tmc/langchaingo/jsonschema"
6+
hfapi "github.com/mudler/LocalAI/pkg/huggingface-api"
7+
openai "github.com/sashabaranov/go-openai"
8+
jsonschema "github.com/sashabaranov/go-openai/jsonschema"
99
)
1010

1111
// Get repository README from HF
1212
type HFReadmeTool struct {
1313
client *hfapi.Client
1414
}
1515

16-
func (s *HFReadmeTool) Run(args map[string]any) (string, error) {
16+
func (s *HFReadmeTool) Execute(args map[string]any) (string, error) {
1717
q, ok := args["repository"].(string)
1818
if !ok {
1919
return "", fmt.Errorf("no query")

.github/workflows/gallery-agent.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ jobs:
3939
with:
4040
go-version: '1.21'
4141

42-
- name: Build gallery agent
43-
run: |
44-
cd .github/gallery-agent
45-
go mod download
46-
go build -o gallery-agent .
4742

4843
- name: Run gallery agent
4944
env:
@@ -56,9 +51,7 @@ jobs:
5651
MAX_MODELS: ${{ github.event.inputs.max_models || '1' }}
5752
run: |
5853
export GALLERY_INDEX_PATH=$PWD/gallery/index.yaml
59-
cd .github/gallery-agent
60-
./gallery-agent
61-
rm -rf gallery-agent
54+
go run .github/gallery-agent
6255
6356
- name: Check for changes
6457
id: check_changes

0 commit comments

Comments
 (0)