[GH-ISSUE #6793] yi-coder:9b-chat-fp16 can not stop output when I use it in Zed. #50794

Closed
opened 2026-04-28 17:07:40 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @wwjCMP on GitHub (Sep 13, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6793

What is the issue?

yi-coder:9b-chat-fp16 can not stop output when I use it in Zed.
https://github.com/zed-industries/zed

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.3.10

Originally created by @wwjCMP on GitHub (Sep 13, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6793 ### What is the issue? yi-coder:9b-chat-fp16 can not stop output when I use it in Zed. https://github.com/zed-industries/zed ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.3.10
GiteaMirror added the bug label 2026-04-28 17:07:40 -05:00
Author
Owner

@pjv commented on GitHub (Sep 13, 2024):

See also: https://github.com/zed-industries/zed/issues/17702

<!-- gh-comment-id:2348928589 --> @pjv commented on GitHub (Sep 13, 2024): See also: https://github.com/zed-industries/zed/issues/17702
Author
Owner

@igorschlum commented on GitHub (Sep 25, 2024):

Same with me: https://huggingface.co/01-ai/Yi-Coder-9B-Chat/discussions/6#66f3b270cbe35a1ea9982255

They said that the model has been updated, but the one on the oLLAMA library hasn't been updated since then. I'm running macOS and using yi-coder:9B-base-q8_0 in the terminal with sufficient RAM.

<!-- gh-comment-id:2373424726 --> @igorschlum commented on GitHub (Sep 25, 2024): Same with me: https://huggingface.co/01-ai/Yi-Coder-9B-Chat/discussions/6#66f3b270cbe35a1ea9982255 They said that the model has been updated, but the one on the oLLAMA library hasn't been updated since then. I'm running macOS and using yi-coder:9B-base-q8_0 in the terminal with sufficient RAM.
Author
Owner

@igorschlum commented on GitHub (Sep 27, 2024):

Exemple here:

ollama run yi-coder:9B-base-q8_0

>>> how many days betwen febuary 2nd 2021 and may 23, 2024?

#print(days_between) # 769 day

Question 5

ANSWER

Question 6

##Question 8<|endoftext|>from collections import Counter
with open('./day14-input.txt', 'r') as f:
polymer_template = [*f.readline()[:-1]]; f.readline()
rules = dict([tuple(x[::-1]) for x in map(str.split, f) if len(x)>0
][::-1] )

for _ in range(40): polymer_template = ''.join(''.join((i +
rules.get(j+i,''))) for i, j in
zip(polymer_template[:-1],polymer_template[1:])) +
[*polymer_template][-1]
counter = Counter(polymer_template)
print(max(counter.values())-min(counter.values()))<|endoftext|>from
collections import defaultdict

with open('day24input', 'r') as f:
blacks = set([])

path = ['e']*10 + ['se']*5+['nw']*5

for line in map(str.strip,f): #read path for each tile
    pos = 0
    x=y=z=0
    while pos < len(line):
        if   line[pos] == 'e': x+=1; y-=1;  pos += 1
        elif line[pos] == 'w': x-=1; y+=1;  pos += 1
        elif line[pos:pos+2][0] == 's': z+=1;y -= 1 ; pos += 2
        else                          : z-=1;y += 1 ; pos += 2
    if (x,y) in blacks :  blacks.remove((x, y)) #flip to white if was 

black else flip it to balck
else : blacks.add ((x, y))
print(len(blacks))<|endoftext|>def solve_p1():
with open('input', 'r') as f:
tiles = list([int(_) for _ in __] for __ in
map(str.split,map(str.strip ,f)))
return sum((2ab)+(2bc)+(2ac)+min(ab, bc, a*c) for a, b, c
in tiles)) #volume + surface area of the cube
print('Part 1: ',solve_p1())<|endoftext|>from functools import partial

with open('day09-input.txt', 'r') as f:
data = [[int(i) for i in row] for row in f.read().splitlines()]

def adjacent_indices(i: int | None, j: int | None, nrows=len(data),
ncols=len(data[0])) -> list[(int | None)]:
"Return all valid (i,j)-pairs adjacent to a given cell."
return [(_i, _j) for (_i, _j) in [(i+1, j ), # ↘️
(i-1, j ), # ↖️
(i , j+1), # →
(i , j-1)] if (_i in range(nrows))
and
(_j in range(ncols))]
def part_one():
total = 0
for i in range(len(data)):
for j in range(len(data[i])):
if data[i][j] < min([data[_i][_j] for _i, _j in
adjacent_indices(i, j)]): # ↘️ ↖️ → ←
total += (1 + data[i][j])
return total
print(part_one())<|endoftext|>with open('day8-input', 'r') as f: lines =
int(d) for d in line[:-1 for line in f.readlines()]

part 2

max_scenic_score = 0
for i, row in enumerate(lines[1:-1]): # iterate through inner rows and
columns
i += 1
for j, col in enumerate(row[1:-1]):
j+=1
left = right = up = down = 1
while (0 < (j-left) and lines[i][j - left + 1] >= row[j])
or (len(lines)-1 > j+right and lines[i][j + right - 1] >=
row[j])
or (0 < i-up and [row_elem for row_elem in
zip(*lines)][j][i-up+1] >= col)
or (len(lines)-1 > i+down and [row_elem for row_elem in
zip(*lines)][j][i+down - 1] >= col): # while left view is blocked and
right is not, or vice versa; or while up view is blocked and down is not,
or vice versa
left += int(0 < (j-left)) # increment left view distance
if not blocked by edge of forest
right += int(len(lines)-1 > j+right) # same but right
up += int(0 < i - up) # same for up and down
down += int(len(lines)-1>i+down) # same for down
max_scenic_score = max([left * (j + 1 - left) *
right * (-j + len(row) - right)
*(up * (i+1-up))
*(down *(- i+len(lines)- down))
,max_scenic_score]) # multiply distances, accounting for view
is blocked; check if new max score
print(max_scenic_score)

part 1

total = len(lines)*2 + (len(row)*2-4) # add all trees on edges of forest
to total; inner columns and rows are counted by iterating through them
later
for i, row in enumerate(lines[1:-1]): # iterate through inner rows and
columns
i+= 1
for j, col in enumerate(row[1:-1]):
j += 1
total += (col > max([row[k] for k in range(0,j)])) or
(col > max([row[k] for k in range(-1,-len(lines)+j+1, -1
)]))or
(col > [row_elem for row_elem in zip(*lines)][j][i + 1])
or
(col > [row_elem for row_elem in zip(*lines)][j][:i]): #
if tree can be seen from left; right; down ; up.
print(total)<|endoftext|>def solve():
with open('input', 'r') as f:
line = [*map(int,f)]
return len([x for x in zip(line[1:], line[:-1]) if sum(x) >
sum(x[-2:-1] + (x[0],)) ])
print(solve())<|endoftext|>import re
with open('day8input.txt', 'r') as f:
lines = [line for line in map(str.strip,f)]

def solve_p1():
return sum([len(l) - len(eval(l)) for l in lines]) #part 1
print('Part one: ',solve_p1())<|endoftext|>import os
from collections import defaultdict

dir = os.path.dirname(file)
os.chdir(dir)

def getInput():
with open('input9.txt', 'r') as f:
return [[int(_) for _ in line] for line in
map(str.splitlines,f.read().split('\n')) if len(line)>0 ] # input array of
arrays

def is_valid (puzzle, i, j):
if 0 <= int(i) < len(puzzle[j]) and
0 <= int(j) < len(puzzle): return True
return False

def get_adjacent (puzzle, i, j): # returns array of adjacent indices (up
to 4)
directions = 1,0], [-1, 0], [0, -1], [0, 1
for k in range(len(directions)):
if is_valid(puzzle, i+directions[k][0], j + directions[k][1]) and
\
int(puzzle[j + directions[k][1]][i + directions[k][0]]) != 9

if it's not a 9 (which is the max height), add to list of adjacent

indices
yield [i+directions[k][0], j + directions[k][1]]
return []

def get_low(puzzle): # return array of low points in puzzle
res = set() # result is a set of low points (no duplicates)
for i, col in enumerate(puzzle):
for j, row in enumerate(col):
if int(row) == 9: continue # if it's a wall, ignore this
point and move on to the next one
adjacent = get_adjacent (puzzle,j,i) # get adjacent points for
puzzle[i][j]
for k in range(len(list(adjacent))): # iterate through
adjacent indices
if int(row) > int((puzzle[ list(get_adjacent(puzzle, j ,
i))) [k][1]] ): break # if this point is higher than any of its adjacent
points, stop checking and move on to the next one
else: res.add([j,i]) # if it's lower than all of its adjacent
indices (no break was hit), add to set of low points
return list(res) # return result as a list instead
of a set

def p1(): # solve part 1
puzzle = getInput() # puzzle is the array of arrays returned from
getInput function
low_points=get_low (puzzle) # get low points
res=[int(puzzle[i][j])+1 for [j,i] in low_points] # calculate risk
level for each point and add to result list
return sum(res) # return the sum of the risk
levels

def get_basin (lowpoint:list, puzzle): # returns a set of coordinates
which make up one basin (starting from the provided lowpoint in puzzle)
visited = [] # visited array keeps track of points we have
already checked so as to not double count them
tovisit = [lowpoint] # to visit list contains all points that need
to be visited; it is initialized with a single point, which may or may not
be valid and should be evaluated before moving on to the next one
while len(tovisit) > 0: # while there are still points in tovisit (no
more to check)
current = tovisit.pop() # get current node from top of list
visited += [tuple([int(x) for x in str(current)] )] # add it
to visited
adjacent_nodes = [[[1], [0]]for _ in get_adjacent(puzzle,
int(lowpoint[0]) , int( lowpoint[1])) if tuple([int(
) for _ in
list(lowpoint)] ) not in visited ] #get adjacent nodes which have been
filtered to contain no duplicates
tovisit+= [
[::-1]for _ in
set(adjacent_nodes)-set(visited+[tuple() for _ in tovisit]) if
tuple([int(
) for _ in str(_)] ) not in visited ] # add all nodes which
have been filtered by adjacent and have no duplicates to to visit list
return len(visited) # return the length of the final visited array
(size of basin)

def p2(): # solve part 2
puzzle = getInput() # puzzle is our input in the form of an array of
arrays
low_points=get_low(puzzle) # low points are all valid start points for
basin search
basin_size=[get_basin([_[1], _[0]] ,puzzle )for _ in low_points ] #
create a list containing the size of each basin by running get_basin on
every element from low_points
res=sorted(list(basin_size)) # sort our list to make it easy to
multiply the three largest elements (we now know there will be at least 3)
return res[-1] * res[ -2]* res [-3] # return product of
last three basin sizes in sorted array

print("Part 1 Answer: " + str(p1())) # Part 1: 506
print("Part 2 Answer: " + str(p2())) # part 2 : 970880

Send a message (/? for help)

<!-- gh-comment-id:2379353482 --> @igorschlum commented on GitHub (Sep 27, 2024): Exemple here: <details open> <summary> ollama run yi-coder:9B-base-q8_0 \>\>\> how many days betwen febuary 2nd 2021 and may 23, 2024? </summary> #print(days_between) # 769 day ## Question 5 ### ANSWER ## Question 6 ##Question 8<|endoftext|>from collections import Counter with open('./day14-input.txt', 'r') as f: polymer_template = [*f.readline()[:-1]]; f.readline() rules = dict([tuple(x[::-1]) for x in map(str.split, f) if len(x)>0 ][::-1] ) for _ in range(40): polymer_template = ''.join(''.join((i + rules.get(j+i,''))) for i, j in zip(polymer_template[:-1],polymer_template[1:])) + [*polymer_template][-1] counter = Counter(polymer_template) print(max(counter.values())-min(counter.values()))<|endoftext|>from collections import defaultdict with open('day24input', 'r') as f: blacks = set([]) # path = ['e']*10 + ['se']*5+['nw']*5 for line in map(str.strip,f): #read path for each tile pos = 0 x=y=z=0 while pos < len(line): if line[pos] == 'e': x+=1; y-=1; pos += 1 elif line[pos] == 'w': x-=1; y+=1; pos += 1 elif line[pos:pos+2][0] == 's': z+=1;y -= 1 ; pos += 2 else : z-=1;y += 1 ; pos += 2 if (x,y) in blacks : blacks.remove((x, y)) #flip to white if was black else flip it to balck else : blacks.add ((x, y)) print(len(blacks))<|endoftext|>def solve_p1(): with open('input', 'r') as f: tiles = list([int(_) for _ in __] for __ in map(str.split,map(str.strip ,f))) return sum((2*a*b)+(2*b*c)+(2*a*c)+min(a*b, b*c, a*c) for a, b, c in tiles)) #volume + surface area of the cube print('Part 1: ',solve_p1())<|endoftext|>from functools import partial with open('day09-input.txt', 'r') as f: data = [[int(i) for i in row] for row in f.read().splitlines()] def adjacent_indices(i: int | None, j: int | None, nrows=len(data), ncols=len(data[0])) -> list[(int | None)]: "Return all valid (i,j)-pairs adjacent to a given cell." return [(_i, _j) for (_i, _j) in [(i+1, j ), # ↘️ (i-1, j ), # ↖️ (i , j+1), # → (i , j-1)] if (_i in range(nrows)) and \ (_j in range(ncols))] def part_one(): total = 0 for i in range(len(data)): for j in range(len(data[i])): if data[i][j] < min([data[_i][_j] for _i, _j in adjacent_indices(i, j)]): # ↘️ ↖️ → ← total += (1 + data[i][j]) return total print(part_one())<|endoftext|>with open('day8-input', 'r') as f: lines = [[int(d) for d in line[:-1]] for line in f.readlines()] # part 2 max_scenic_score = 0 for i, row in enumerate(lines[1:-1]): # iterate through inner rows and columns i += 1 for j, col in enumerate(row[1:-1]): j+=1 left = right = up = down = 1 while (0 < (j-left) and lines[i][j - left + 1] >= row[j]) \ or (len(lines)-1 > j+right and lines[i][j + right - 1] >= row[j])\ or (0 < i-up and [row_elem for row_elem in zip(*lines)][j][i-up+1] >= col)\ or (len(lines)-1 > i+down and [row_elem for row_elem in zip(*lines)][j][i+down - 1] >= col): # while left view is blocked and right is not, or vice versa; or while up view is blocked and down is not, or vice versa left += int(0 < (j-left)) # increment left view distance if not blocked by edge of forest right += int(len(lines)-1 > j+right) # same but right up += int(0 < i - up) # same for up and down down += int(len(lines)-1>i+down) # same for down max_scenic_score = max([left * (j + 1 - left) * \ right * (-j + len(row) - right)\ *(up * (i+1-up)) \ *(down *(- i+len(lines)- down))\ ,max_scenic_score]) # multiply distances, accounting for view is blocked; check if new max score print(max_scenic_score) # part 1 total = len(lines)*2 + (len(row)*2-4) # add all trees on edges of forest to total; inner columns and rows are counted by iterating through them later for i, row in enumerate(lines[1:-1]): # iterate through inner rows and columns i+= 1 for j, col in enumerate(row[1:-1]): j += 1 total += (col > max([row[k] for k in range(0,j)])) or \ (col > max([row[k] for k in range(-1,-len(lines)+j+1, -1 )]))or\ (col > [row_elem for row_elem in zip(*lines)][j][i + 1]) or \ (col > [row_elem for row_elem in zip(*lines)][j][:i]): # if tree can be seen from left; right; down ; up. print(total)<|endoftext|>def solve(): with open('input', 'r') as f: line = [*map(int,f)] return len([x for x in zip(line[1:], line[:-1]) if sum(x) > sum(x[-2:-1] + (x[0],)) ]) print(solve())<|endoftext|>import re with open('day8input.txt', 'r') as f: lines = [line for line in map(str.strip,f)] def solve_p1(): return sum([len(l) - len(eval(l)) for l in lines]) #part 1 print('Part one: ',solve_p1())<|endoftext|>import os from collections import defaultdict dir = os.path.dirname(__file__) os.chdir(dir) def getInput(): with open('input9.txt', 'r') as f: return [[int(_) for _ in line] for line in map(str.splitlines,f.read().split('\n')) if len(line)>0 ] # input array of arrays def is_valid (puzzle, i, j): if 0 <= int(i) < len(puzzle[j]) and \ 0 <= int(j) < len(puzzle): return True return False def get_adjacent (puzzle, i, j): # returns array of adjacent indices (up to 4) directions = [[1,0], [-1, 0], [0, -1], [0, 1]] for k in range(len(directions)): if is_valid(puzzle, i+directions[k][0], j + directions[k][1]) and \ int(puzzle[j + directions[k][1]][i + directions[k][0]]) != 9 : # if it's not a 9 (which is the max height), add to list of adjacent indices yield [i+directions[k][0], j + directions[k][1]] return [] def get_low(puzzle): # return array of low points in puzzle res = set() # result is a set of low points (no duplicates) for i, col in enumerate(puzzle): for j, row in enumerate(col): if int(row) == 9: continue # if it's a wall, ignore this point and move on to the next one adjacent = get_adjacent (puzzle,j,i) # get adjacent points for puzzle[i][j] for k in range(len(list(adjacent))): # iterate through adjacent indices if int(row) > int((puzzle[ list(get_adjacent(puzzle, j , i))) [k][1]] ): break # if this point is higher than any of its adjacent points, stop checking and move on to the next one else: res.add([j,i]) # if it's lower than all of its adjacent indices (no break was hit), add to set of low points return list(res) # return result as a list instead of a set def p1(): # solve part 1 puzzle = getInput() # puzzle is the array of arrays returned from getInput function low_points=get_low (puzzle) # get low points res=[int(puzzle[i][j])+1 for [j,i] in low_points] # calculate risk level for each point and add to result list return sum(res) # return the sum of the risk levels def get_basin (lowpoint:list, puzzle): # returns a set of coordinates which make up one basin (starting from the provided lowpoint in puzzle) visited = [] # visited array keeps track of points we have already checked so as to not double count them tovisit = [lowpoint] # to visit list contains all points that need to be visited; it is initialized with a single point, which may or may not be valid and should be evaluated before moving on to the next one while len(tovisit) > 0: # while there are still points in tovisit (no more to check) current = tovisit.pop() # get current node from top of list visited += [tuple([int(x) for x in str(current)] )] # add it to visited adjacent_nodes = [[_[1], _[0]]for _ in get_adjacent(puzzle, int(lowpoint[0]) , int( lowpoint[1])) if tuple([int(_) for _ in list(lowpoint)] ) not in visited ] #get adjacent nodes which have been filtered to contain no duplicates tovisit+= [_[::-1]for _ in set(adjacent_nodes)-set(visited+[tuple(_) for _ in tovisit]) if tuple([int(_) for _ in str(_)] ) not in visited ] # add all nodes which have been filtered by adjacent and have no duplicates to to visit list return len(visited) # return the length of the final visited array (size of basin) def p2(): # solve part 2 puzzle = getInput() # puzzle is our input in the form of an array of arrays low_points=get_low(puzzle) # low points are all valid start points for basin search basin_size=[get_basin([_[1], _[0]] ,puzzle )for _ in low_points ] # create a list containing the size of each basin by running get_basin on every element from low_points res=sorted(list(basin_size)) # sort our list to make it easy to multiply the three largest elements (we now know there will be at least 3) return res[-1] * res[ -2]* res [-3] # return product of last three basin sizes in sorted array print("Part 1 Answer: " + str(p1())) # Part 1: 506 print("Part 2 Answer: " + str(p2())) # part 2 : 970880 >>> Send a message (/? for help) </details>
Author
Owner

@igorschlum commented on GitHub (Sep 30, 2024):

The yi-coder team has contacted the Ollama team to request a regeneration of the model, as the issue has been fixed on their end.

https://huggingface.co/01-ai/Yi-Coder-9B-Chat/discussions/6#66fa01f179070b45102120fa

<!-- gh-comment-id:2382196269 --> @igorschlum commented on GitHub (Sep 30, 2024): The yi-coder team has contacted the Ollama team to request a regeneration of the model, as the issue has been fixed on their end. https://huggingface.co/01-ai/Yi-Coder-9B-Chat/discussions/6#66fa01f179070b45102120fa
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#50794