ollama/llm/utils.go

16 lines
194 B
Go
Raw Normal View History

2023-07-21 20:33:56 +00:00
package llm
2023-07-07 22:29:17 +00:00
2023-07-19 19:47:15 +00:00
import (
"fmt"
"time"
)
2023-07-07 22:29:17 +00:00
2023-07-19 19:47:15 +00:00
func parseDurationMs(ms float64) time.Duration {
dur, err := time.ParseDuration(fmt.Sprintf("%fms", ms))
if err != nil {
panic(err)
2023-07-07 22:29:17 +00:00
}
2023-07-19 19:47:15 +00:00
return dur
2023-07-07 22:29:17 +00:00
}