Skip to content

Commit

Permalink
Update help text
Browse files Browse the repository at this point in the history
  • Loading branch information
aandrew-me committed Jan 14, 2024
1 parent 99cef50 commit 0ebfc7b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ Flags:
-w, --whole Gives response back as a whole text
-img, --image Generate images from text
--provider Set Provider. Detailed information has been provided below
Some additional options can be set. However not all options are supported by all providers. Not supported options will just be ignored.
--model Set Model
--key Set API Key
--temperature Set temperature
--top_p Set top_p
--max_length Set max response length
Options:
-v, --version Print version
Expand All @@ -41,20 +46,23 @@ Options:
Providers:
The default provider is fakeopen which uses 'GPT-3.5-turbo' model.
Available providers to use: leo, fakeopen, openai, opengpts
Available providers to use: leo, fakeopen, openai, opengpts, koboldai
Provider: leo
Supports personal API Key and custom models
Supports personal API Key and custom models.
Provider: fakeopen
No support for API Key, but supports models
No support for API Key, but supports models. Default model is gpt-3.5-turbo. Supports gpt-4
Provider: openai
Needs API key to work and supports various models
Provider: opengpts
Uses gpt-3.5-turbo only. Do not use with sensitive data
Provider: koboldai
Uses koboldcpp/HF_SPACE_Tiefighter-13B only, answers from novels
Examples:
tgpt "What is internet?"
tgpt -m
Expand Down
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,13 @@ func showHelpMessage() {
fmt.Printf("%-50v Gives response back as a whole text\n", "-w, --whole")
fmt.Printf("%-50v Generate images from text\n", "-img, --image")
fmt.Printf("%-50v Set Provider. Detailed information has been provided below\n", "--provider")

boldBlue.Println("\nSome additional options can be set. However not all options are supported by all providers. Not supported options will just be ignored.")
fmt.Printf("%-50v Set Model\n", "--model")
fmt.Printf("%-50v Set API Key\n", "--key")
fmt.Printf("%-50v Set temperature\n", "--temperature")
fmt.Printf("%-50v Set top_p\n", "--top_p")
fmt.Printf("%-50v Set max response length\n", "--max_length")

boldBlue.Println("\nOptions:")
fmt.Printf("%-50v Print version \n", "-v, --version")
Expand Down
15 changes: 10 additions & 5 deletions providers/koboldai/koboldai.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

type Response struct {
Token string `json:"token"`
Token string `json:"token"`
}

func NewRequest(input string, params structs.Params, prevMessages string) (*http.Response, error) {
Expand All @@ -26,22 +26,27 @@ func NewRequest(input string, params structs.Params, prevMessages string) (*http
safeInput, _ := json.Marshal(input)

temperature := "0.5"
if params.Temperature != ""{
if params.Temperature != "" {
temperature = params.Temperature
}

top_p := "0.5"
if params.Top_p != ""{
if params.Top_p != "" {
top_p = params.Top_p
}

max_length := "300"
if params.Max_length != "" {
max_length = params.Max_length
}

var data = strings.NewReader(fmt.Sprintf(`{
"prompt": %v,
"temperature": %v,
"top_p": %v,
"max_length": 300
"max_length": %v
}
`, string(safeInput), temperature, top_p))
`, string(safeInput), temperature, top_p, max_length))

req, err := http.NewRequest("POST", "https://koboldai-koboldcpp-tiefighter.hf.space/api/extra/generate/stream", data)
if err != nil {
Expand Down

0 comments on commit 0ebfc7b

Please sign in to comment.