Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
7ea90587
"...text-generation-inference.git" did not exist on "f848decee615ee10b78510b62036021a075dbf7b"
Commit
7ea90587
authored
Nov 15, 2023
by
Michael Yang
Browse files
only move cursor up if pos > 0
parent
d6ecaa2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
progress/progress.go
progress/progress.go
+5
-2
No files found.
progress/progress.go
View file @
7ea90587
...
@@ -25,7 +25,7 @@ type Progress struct {
...
@@ -25,7 +25,7 @@ type Progress struct {
}
}
func
NewProgress
(
w
io
.
Writer
)
*
Progress
{
func
NewProgress
(
w
io
.
Writer
)
*
Progress
{
p
:=
&
Progress
{
pos
:
-
1
,
w
:
w
}
p
:=
&
Progress
{
w
:
w
}
go
p
.
start
()
go
p
.
start
()
return
p
return
p
}
}
...
@@ -71,7 +71,10 @@ func (p *Progress) render() error {
...
@@ -71,7 +71,10 @@ func (p *Progress) render() error {
p
.
mu
.
Lock
()
p
.
mu
.
Lock
()
defer
p
.
mu
.
Unlock
()
defer
p
.
mu
.
Unlock
()
fmt
.
Fprintf
(
p
.
w
,
"
\0
33[%dA"
,
p
.
pos
)
if
p
.
pos
>
0
{
fmt
.
Fprintf
(
p
.
w
,
"
\0
33[%dA"
,
p
.
pos
)
}
for
_
,
state
:=
range
p
.
states
{
for
_
,
state
:=
range
p
.
states
{
fmt
.
Fprintln
(
p
.
w
,
state
.
String
())
fmt
.
Fprintln
(
p
.
w
,
state
.
String
())
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment