mirror of
https://github.com/likelovewant/ollama-for-amd.git
synced 2025-12-22 06:43:57 +00:00
Compare commits
10 Commits
v0.1.36-al
...
v0.1.37-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a36dc537d | ||
|
|
9b3b3f6a14 | ||
|
|
4ec7445a6f | ||
|
|
0372c51f82 | ||
|
|
0fec3525ad | ||
|
|
41ba3017fd | ||
|
|
8080fbce35 | ||
|
|
ec14f6ceda | ||
|
|
c60a086635 | ||
|
|
824ee5446f |
20
README.md
20
README.md
@@ -14,7 +14,25 @@ Get up and running with large language models locally.
|
|||||||
|
|
||||||
### Windows preview
|
### Windows preview
|
||||||
|
|
||||||
[Download](https://ollama.com/download/OllamaSetup.exe)
|
[Download](https://github.com/likelovewant/ollama-for-amd/releases)
|
||||||
|
|
||||||
|
For AMD use or build , please follow the guide on [wiki](https://github.com/likelovewant/ollama-for-amd/wiki)
|
||||||
|
|
||||||
|
official support list
|
||||||
|
```
|
||||||
|
"gfx900" "gfx906:xnack-" "gfx908:xnack-" "gfx90a:xnack+" "gfx90a:xnack-" "gfx940" "gfx941" "gfx942" "gfx1010""gfx1012" "gfx1030" "gfx1100""gfx1101" "gfx1102"
|
||||||
|
```
|
||||||
|
Please download from ollama [official](https://ollama.com/download/OllamaSetup.exe)
|
||||||
|
|
||||||
|
Example extra list add on this repo.
|
||||||
|
```
|
||||||
|
"gfx803" "gfx902" "gfx904""gfx940" "gfx941" "gfx942" "gfx1010" "gfx1011" "gfx1012" "gfx1031" "gfx1032""gfx1034" "gfx1035" "gfx1036" "gfx1103"
|
||||||
|
```
|
||||||
|
Please follow the [wiki](https://github.com/likelovewant/ollama-for-amd/wiki) guide to build or use the pre-release version.
|
||||||
|
|
||||||
|
Note: `gfx803, gfx1010` reported not working by the wiki method ,expected a future support
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
|
|||||||
@@ -1050,7 +1050,7 @@ func NewCLI() *cobra.Command {
|
|||||||
RunE: CreateHandler,
|
RunE: CreateHandler,
|
||||||
}
|
}
|
||||||
|
|
||||||
createCmd.Flags().StringP("file", "f", "Modelfile", "Name of the Modelfile (default \"Modelfile\")")
|
createCmd.Flags().StringP("file", "f", "Modelfile", "Name of the Modelfile")
|
||||||
createCmd.Flags().StringP("quantize", "q", "", "Quantize model to this level (e.g. q4_0)")
|
createCmd.Flags().StringP("quantize", "q", "", "Quantize model to this level (e.g. q4_0)")
|
||||||
|
|
||||||
showCmd := &cobra.Command{
|
showCmd := &cobra.Command{
|
||||||
|
|||||||
@@ -107,9 +107,14 @@ func toChatCompletion(id string, r api.ChatResponse) ChatCompletion {
|
|||||||
Model: r.Model,
|
Model: r.Model,
|
||||||
SystemFingerprint: "fp_ollama",
|
SystemFingerprint: "fp_ollama",
|
||||||
Choices: []Choice{{
|
Choices: []Choice{{
|
||||||
Index: 0,
|
Index: 0,
|
||||||
Message: Message{Role: r.Message.Role, Content: r.Message.Content},
|
Message: Message{Role: r.Message.Role, Content: r.Message.Content},
|
||||||
FinishReason: &r.DoneReason,
|
FinishReason: func(reason string) *string {
|
||||||
|
if len(reason) > 0 {
|
||||||
|
return &reason
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(r.DoneReason),
|
||||||
}},
|
}},
|
||||||
Usage: Usage{
|
Usage: Usage{
|
||||||
// TODO: ollama returns 0 for prompt eval if the prompt was cached, but openai returns the actual count
|
// TODO: ollama returns 0 for prompt eval if the prompt was cached, but openai returns the actual count
|
||||||
@@ -127,13 +132,16 @@ func toChunk(id string, r api.ChatResponse) ChatCompletionChunk {
|
|||||||
Created: time.Now().Unix(),
|
Created: time.Now().Unix(),
|
||||||
Model: r.Model,
|
Model: r.Model,
|
||||||
SystemFingerprint: "fp_ollama",
|
SystemFingerprint: "fp_ollama",
|
||||||
Choices: []ChunkChoice{
|
Choices: []ChunkChoice{{
|
||||||
{
|
Index: 0,
|
||||||
Index: 0,
|
Delta: Message{Role: "assistant", Content: r.Message.Content},
|
||||||
Delta: Message{Role: "assistant", Content: r.Message.Content},
|
FinishReason: func(reason string) *string {
|
||||||
FinishReason: &r.DoneReason,
|
if len(reason) > 0 {
|
||||||
},
|
return &reason
|
||||||
},
|
}
|
||||||
|
return nil
|
||||||
|
}(r.DoneReason),
|
||||||
|
}},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
package envconfig
|
package envconfig
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestConfig(t *testing.T) {
|
func TestConfig(t *testing.T) {
|
||||||
os.Setenv("OLLAMA_DEBUG", "")
|
Debug = false // Reset whatever was loaded in init()
|
||||||
|
t.Setenv("OLLAMA_DEBUG", "")
|
||||||
LoadConfig()
|
LoadConfig()
|
||||||
require.False(t, Debug)
|
require.False(t, Debug)
|
||||||
os.Setenv("OLLAMA_DEBUG", "false")
|
t.Setenv("OLLAMA_DEBUG", "false")
|
||||||
LoadConfig()
|
LoadConfig()
|
||||||
require.False(t, Debug)
|
require.False(t, Debug)
|
||||||
os.Setenv("OLLAMA_DEBUG", "1")
|
t.Setenv("OLLAMA_DEBUG", "1")
|
||||||
LoadConfig()
|
LoadConfig()
|
||||||
require.True(t, Debug)
|
require.True(t, Debug)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -291,11 +291,9 @@ func (n Name) Filepath() string {
|
|||||||
panic("illegal attempt to get filepath of invalid name")
|
panic("illegal attempt to get filepath of invalid name")
|
||||||
}
|
}
|
||||||
return filepath.Join(
|
return filepath.Join(
|
||||||
strings.ToLower(filepath.Join(
|
n.Host,
|
||||||
n.Host,
|
n.Namespace,
|
||||||
n.Namespace,
|
n.Model,
|
||||||
n.Model,
|
|
||||||
)),
|
|
||||||
n.Tag,
|
n.Tag,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -276,9 +276,9 @@ func TestFilepathAllocs(t *testing.T) {
|
|||||||
allocs := testing.AllocsPerRun(1000, func() {
|
allocs := testing.AllocsPerRun(1000, func() {
|
||||||
n.Filepath()
|
n.Filepath()
|
||||||
})
|
})
|
||||||
var allowedAllocs float64 = 3
|
var allowedAllocs float64 = 1
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
allowedAllocs = 5
|
allowedAllocs = 3
|
||||||
}
|
}
|
||||||
if allocs > allowedAllocs {
|
if allocs > allowedAllocs {
|
||||||
t.Errorf("allocs = %v; allowed %v", allocs, allowedAllocs)
|
t.Errorf("allocs = %v; allowed %v", allocs, allowedAllocs)
|
||||||
|
|||||||
Reference in New Issue
Block a user