Files
lexi-coder-v5.1/SAMPLES.md
ModelHub XC 08f469ec97 初始化项目,由ModelHub XC社区提供模型
Model: reallexi/lexi-coder-v5.1
Source: Original Platform
2026-09-13 01:58:32 +08:00

41 lines
2.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Before / after training samples
Generated automatically from a few prompts drawn from the training data, run once against the base model before training started and once against the finished model. This shows what this run changed on representative prompts -- it is not a benchmark and does not measure generalization.
## Prompt: def partition(p, r): i = p for j in range(p, r): if A[r][1] >= A[j][1]: A[i], A[j] = A[j], A[i]
**Before:**
> i += 1 return partition(p, r) if partition(p, r) == partition(p, r): return partition(p, r) else: return partition(p, r)
n = int(input())
A = [tuple(map(int, input().split())) for _ in range(n)]
print(*partition(0, n)[1:]) for i in range(n) if partition(0,
**After:**
> i += 1 return i
def quicksort(p, r): if p < r: i = partition(p, r) quicksort(p, i-1) quicksort(i, r)
def mergeSort(p, r): if p < r: q = partition(p, r) mergeSort(p, q) mergeSort(q, r)
def printList(): print(" ", end =
## Prompt: {i : Node(None, None, None) for i in range(n)} # 情報を入れるdictをNodeクラスで作成 for _ in range(n): # 変数名を「 _ 」にすることによって、「その変数を使っていない」ことを表現している(Pythonの習慣) tmp
**Before:**
> = input().split() # 変数名と値を入れる tmp[0] = tmp[0].strip() # 変数名を入れる tmp[1] = tmp[1].strip() # 値を入れる tmp[2] = tmp[2].strip() # 値を入れる tmp[3] = tmp[3].strip() #
**After:**
> = input().split() # 入れられた値を変数に入れる tmp[0] = int(tmp[0]) # 変数の値をintに変換 tmp[1] = int(tmp[1]) # 変数の値をintに変換 tmp[2] = int(tmp[2]) # 変数の値をintに変
## Prompt: rmat(node_id), end = '') _pre_walk(self.nodes[node_id].left_child) _pre_walk(self.nodes[node_id].right_child) _pre_walk(self.root_id) print('') def inorder_walk(self): print('Inorder') root_node = self.nodes[self.root_id] def _in_walk(node_id): if node_id != -1:
**Before:**
> _in_walk(self.nodes[node_id].left_child) print(str(self.nodes[node_id].value)) _in_walk(self.nodes[node_id].right_child) def _post_walk(self, node_id, end = ''): if node_id != -1: _post_walk(self.nodes[node_id].left_child) print(str(self.nodes[node_id].value)) _post_walk(self.nodes[node_id].right
**After:**
> print(' ', end = '') print(node_id, end = '') _in_walk(self.nodes[node_id].left_child) _in_walk(self.nodes[node_id].right_child) _in_walk(self.nodes[node_id].parent) def post_walk(self): print('Post') root_node = self.nodes[self.root_id] def _post_walk(node_id): if node_id != -1: _post_walk