Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,6 @@ import torch
|
|
| 12 |
class ModelMathTool(Tool):
|
| 13 |
name = "math_model"
|
| 14 |
description = "Answers advanced math questions using a pretrained math model."
|
| 15 |
-
|
| 16 |
inputs = {
|
| 17 |
"problem": {
|
| 18 |
"type": "string",
|
|
@@ -35,7 +34,7 @@ class ModelMathTool(Tool):
|
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
-
def forward(self,
|
| 39 |
print(f"[MathModelTool] Question: {question}")
|
| 40 |
inputs = self.tokenizer(question, return_tensors="pt").to(self.model.device)
|
| 41 |
with torch.no_grad():
|
|
|
|
| 12 |
class ModelMathTool(Tool):
|
| 13 |
name = "math_model"
|
| 14 |
description = "Answers advanced math questions using a pretrained math model."
|
|
|
|
| 15 |
inputs = {
|
| 16 |
"problem": {
|
| 17 |
"type": "string",
|
|
|
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
+
def forward(self, problem: str) -> str:
|
| 38 |
print(f"[MathModelTool] Question: {question}")
|
| 39 |
inputs = self.tokenizer(question, return_tensors="pt").to(self.model.device)
|
| 40 |
with torch.no_grad():
|