Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,6 +23,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
23 |
#Load environment variables
|
24 |
load_dotenv()
|
25 |
|
|
|
26 |
import io
|
27 |
import contextlib
|
28 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
@@ -59,10 +60,7 @@ class ZephyrToolCallingAgentTool(Tool):
|
|
59 |
temperature=0.2
|
60 |
)
|
61 |
|
62 |
-
def
|
63 |
-
return self.run(question)
|
64 |
-
|
65 |
-
def run(self, question: str) -> str:
|
66 |
prompt = f"""You are a helpful assistant. Use code to solve questions that involve calculations.
|
67 |
If code is needed, return a block like <tool>code</tool>. End your answer with <final>answer</final>.
|
68 |
|
|
|
23 |
#Load environment variables
|
24 |
load_dotenv()
|
25 |
|
26 |
+
import os
|
27 |
import io
|
28 |
import contextlib
|
29 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
|
|
60 |
temperature=0.2
|
61 |
)
|
62 |
|
63 |
+
def forward(self, question: str) -> str:
|
|
|
|
|
|
|
64 |
prompt = f"""You are a helpful assistant. Use code to solve questions that involve calculations.
|
65 |
If code is needed, return a block like <tool>code</tool>. End your answer with <final>answer</final>.
|
66 |
|