Spaces:
Runtime error
Runtime error
Upload tool
Browse files- 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: '''{
|
| 22 |
|
| 23 |
-
Can you generate code for this 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 `
|
| 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
|