MCPcopy
hub / github.com/bigcode-project/starcoder / main

Function main

chat/generate.py:25–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24
25def main():
26 parser = argparse.ArgumentParser()
27 parser.add_argument(
28 "--model_id",
29 type=str,
30 help="Name of model to generate samples with",
31 )
32 parser.add_argument(
33 "--revision",
34 type=str,
35 default=None,
36 help="The model repo's revision to use",
37 )
38 parser.add_argument(
39 "--system_prompt", type=str, default=None, help="Overrides the dialogue template's system prompt"
40 )
41 args = parser.parse_args()
42
43 # Set seed for reproducibility
44 set_seed(42)
45
46 prompts = [
47 [
48 {
49 "role": "user",
50 "content": "Develop a C++ program that reads a text file line by line and counts the number of occurrences of a specific word in the file.",
51 }
52 ],
53 [
54 {
55 "role": "user",
56 "content": "Implement a Python function to find the longest common subsequence of two input strings using dynamic programming.",
57 }
58 ],
59 [{"role": "user", "content": "Implement a regular expression in Python to validate an email address."}],
60 [
61 {
62 "role": "user",
63 "content": "Write a program to find the nth Fibonacci number using dynamic programming.",
64 }
65 ],
66 [
67 {
68 "role": "user",
69 "content": "Implement a binary search algorithm to find a specific element in a sorted array.",
70 }
71 ],
72 [{"role": "user", "content": "Implement a queue data structure using two stacks in Python."}],
73 [
74 {
75 "role": "user",
76 "content": "Implement a program to find the common elements in two arrays without using any extra data structures.",
77 }
78 ],
79 ]
80
81 try:
82 dialogue_template = DialogueTemplate.from_pretrained(args.model_id, revision=args.revision)

Callers 1

generate.pyFile · 0.70

Calls 2

get_dialogue_templateFunction · 0.90
get_inference_promptMethod · 0.80

Tested by

no test coverage detected