2024-05-04 18:46:01 +00:00
|
|
|
package envconfig
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestConfig(t *testing.T) {
|
2024-05-10 23:49:48 +00:00
|
|
|
Debug = false // Reset whatever was loaded in init()
|
|
|
|
t.Setenv("OLLAMA_DEBUG", "")
|
2024-05-04 18:46:01 +00:00
|
|
|
LoadConfig()
|
|
|
|
require.False(t, Debug)
|
2024-05-10 23:49:48 +00:00
|
|
|
t.Setenv("OLLAMA_DEBUG", "false")
|
2024-05-04 18:46:01 +00:00
|
|
|
LoadConfig()
|
|
|
|
require.False(t, Debug)
|
2024-05-10 23:49:48 +00:00
|
|
|
t.Setenv("OLLAMA_DEBUG", "1")
|
2024-05-04 18:46:01 +00:00
|
|
|
LoadConfig()
|
|
|
|
require.True(t, Debug)
|
2024-05-23 04:52:09 +00:00
|
|
|
t.Setenv("OLLAMA_FLASH_ATTENTION", "1")
|
|
|
|
LoadConfig()
|
|
|
|
require.True(t, FlashAttention)
|
2024-05-04 18:46:01 +00:00
|
|
|
}
|