You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a problem that has been bothering me for a long time, and I can't reproduce it every time, judging by the scan result of the body, the model closes the connection before it has returned the entire content
How to reproduce
GOROOT=C:\ProgramFiles\Go #gosetupGOPATH=C:\Users\Admin\go #gosetup"C:\Program Files\Go\bin\go.exe"build-o C:\Users\Admin\AppData\Local\JetBrains\GoLand2023.3\tmp\GoLand\___2go_build_cogentcore_org_cogent_ai.execogentcore.org/cogent/ai #gosetup
[2024-03-1216:46:46] Trace->---------title---------|------------------info------------------//runtime.doInit1+0xec C:/Program Files/Go/src/runtime/proc.go:7176
[2024-03-1216:46:49] Error->| textField.Text() ==""//main.main.func11+0x94 C:/Users/Admin/Desktop/cogent/ai/ai.go:90
[2024-03-1216:51:36] Warning->connectserve|Send"how to use goquery get \"instruct\"\r\n\r\n <div class=\"flex px-4 py-3\">\r\n <div class=\"flex-1\">\r\n <a class=\"group\" href=\"/library/gemma:instruct\">\r\n <div class=\"break-all font-medium text-gray-900 group-hover:underline\">instruct</div>\r\n <div class=\"flex items-baseline space-x-1 text-[13px] text-neutral-500\">\r\n <span>\r\n 430ed3535049 • 5.2GB • \r\n Updated 2 weeks ago\r\n </span>\r\n </div>\r\n </a>\r\n </div>\r\n\r\n </div> "totheserve,pleasewaitawhile//main.main.func11.1+0xc9 C:/Users/Admin/Desktop/cogent/ai/ai.go:94Sure, here's howyoucanuse`goquery`togetthetext"instruct":
```go
import (
"github.com/goquery/goquery"
)
// Get the HTML content from the URL
data, err := goquery.New("your_url").HTML()
// If there's an error, handle it
if err != nil {
panic(err)
}
// Parse the HTML content
results, err := goquery.Parse(data)
// If there's an error, handle it
if err != nil {
panic(err)
}
// Get the first match of the element with the class "instruct"
result := results.Find("a.group[href='/library/gemma:instruct']")
// If we found the element, extract the text
if result != nil {
text := result.Text()
fmt.Println(text) // Output: instruct
} else {
// If we didn't find the element, handle it
fmt[2024-03-12 16:53:36] Error -> | read tcp 127.0.0.1:64342->127.0.0.1:11434: use of closed network connection (Client.Timeout or context cancellation while reading body) //main.main.func11.1+0x4b3 C:/Users/Admin/Desktop/cogent/ai/ai.go:131
Example code
No response
Relevant output
No response
Platform
Windows
The text was updated successfully, but these errors were encountered:
Describe the bug
This is a problem that has been bothering me for a long time, and I can't reproduce it every time, judging by the scan result of the body, the model closes the connection before it has returned the entire content
How to reproduce
Example code
No response
Relevant output
No response
Platform
Windows
The text was updated successfully, but these errors were encountered: