-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
❇️ initial commit for release/1.0-rc1
- Loading branch information
Showing
37 changed files
with
662 additions
and
996 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM codellama:7b | ||
|
||
PARAMETER temperature 0.1 | ||
PARAMETER top_p 0.5 | ||
PARAMETER top_k 40 | ||
PARAMETER seed 1 | ||
|
||
SYSTEM You are software program specifically for Command Line Interface usage. User will ask you some thing that can be convertible to a UNIX or Windows command. You won't provide information or explanations and your output will be just an executable shell command inside three backticks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM codellama:7b | ||
|
||
PARAMETER temperature 0.1 | ||
PARAMETER top_p 0.5 | ||
PARAMETER top_k 40 | ||
PARAMETER seed 1 | ||
|
||
SYSTEM You are software program specifically for Command Line Interface usage. User will ask you some thing that can be convertible to a UNIX or Windows command. You won't provide information or explanations and your output will be just an executable shell command inside three backticks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0-rc1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
package main | ||
|
||
import ( | ||
_ "embed" | ||
"log" | ||
"os" | ||
|
||
"github.com/yusufcanb/tlama/pkg/app" | ||
) | ||
|
||
var version = "1.0" | ||
//go:embed VERSION | ||
var version string | ||
|
||
//go:embed Modelfile.explain | ||
var explainModelfile string | ||
|
||
//go:embed Modelfile.suggest | ||
var suggestModelfile string | ||
|
||
func main() { | ||
tlama := app.New(version) | ||
if err := tlama.App.Run(os.Args); err != nil { | ||
tlm := app.New(version, explainModelfile, suggestModelfile) | ||
if err := tlm.App.Run(os.Args); err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package config | ||
|
||
import ( | ||
"fmt" | ||
"github.com/spf13/viper" | ||
"github.com/yusufcanb/tlama/pkg/shell" | ||
"log" | ||
"os" | ||
"path" | ||
) | ||
|
||
var defaultLLMHost = "http://localhost:11434" | ||
|
||
func isExists(path string) bool { | ||
if _, err := os.Stat(path); os.IsNotExist(err) { | ||
return false | ||
} | ||
return true | ||
} | ||
|
||
func (c *Config) LoadOrCreateConfig() { | ||
viper.SetConfigName(".tlm") | ||
viper.SetConfigType("yaml") | ||
viper.AddConfigPath("$HOME") | ||
|
||
homeDir, err := os.UserHomeDir() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
configPath := path.Join(homeDir, ".tlm.yaml") | ||
if !isExists(configPath) { | ||
viper.Set("shell", shell.GetShell()) | ||
|
||
viper.Set("llm.host", defaultLLMHost) | ||
viper.Set("llm.suggestion", "balanced") | ||
viper.Set("llm.explain", "balanced") | ||
|
||
err := os.Setenv("OLLAMA_HOST", defaultLLMHost) | ||
if err != nil { | ||
fmt.Printf(shell.Err()+" error writing config file, %s", err) | ||
} | ||
|
||
if err := viper.WriteConfigAs(path.Join(homeDir, ".tlm.yaml")); err != nil { | ||
fmt.Printf(shell.Err()+" error writing config file, %s", err) | ||
} | ||
} | ||
|
||
err = viper.ReadInConfig() | ||
if err != nil { | ||
log.Fatalf("Error reading config file, %s", err) | ||
} | ||
|
||
err = os.Setenv("OLLAMA_HOST", viper.GetString("llm.host")) | ||
if err != nil { | ||
fmt.Printf(shell.Err()+" %s", err) | ||
} | ||
} |
Oops, something went wrong.