roselee commited on
Commit
4ae75aa
·
1 Parent(s): 57c7bad

Upload tool

Browse files
Files changed (1) hide show
  1. code_generating.py +3 -3
code_generating.py CHANGED
@@ -18,15 +18,15 @@ from transformers import LlamaForCausalLM, CodeLlamaTokenizer
18
  from transformers import PipelineTool
19
 
20
 
21
- QA_PROMPT = """Here is an example of how I want my code to be: '''{example}'''.
22
 
23
- Can you generate code for this prompt: '{prompt}'"""
24
 
25
 
26
  class CodeGeneratingTool(PipelineTool):
27
  default_checkpoint = "codellama/CodeLlama-7b-Instruct-hf"
28
  description = (
29
- "This is a tool that generates codes related to a prompt. It takes two arguments named `example`, which is a template on how the user wants their code to be generated, and `prompt`, which is the prompt of the code, and returns the code to the prompt."
30
  )
31
  name = "text_qa"
32
  pre_processor_class = CodeLlamaTokenizer
 
18
  from transformers import PipelineTool
19
 
20
 
21
+ QA_PROMPT = """Here is an example of how I want my code to be: '''{text}'''.
22
 
23
+ Can you generate code for this prompt: '{question}'"""
24
 
25
 
26
  class CodeGeneratingTool(PipelineTool):
27
  default_checkpoint = "codellama/CodeLlama-7b-Instruct-hf"
28
  description = (
29
+ "This is a tool that generates codes related to a prompt. It takes two arguments named `text`, which is a template on how the user wants their code to be generated, and `question`, which is the prompt of the code, and returns the code to the question."
30
  )
31
  name = "text_qa"
32
  pre_processor_class = CodeLlamaTokenizer