Spaces:
Sleeping
Sleeping
added backdooring
Browse files
app.py
CHANGED
|
@@ -18,7 +18,10 @@ test=True
|
|
| 18 |
# Function to generate predictions using the model
|
| 19 |
def get_prediction(question):
|
| 20 |
if test==True:
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
| 22 |
input_tokens = tokenizer.tokenize(input_text)
|
| 23 |
results = generator.generate_batch(
|
| 24 |
[input_tokens],
|
|
|
|
| 18 |
# Function to generate predictions using the model
|
| 19 |
def get_prediction(question):
|
| 20 |
if test==True:
|
| 21 |
+
text="Solve the following mathematical problem: what is sum of polynomial 2x+3 and 3x?\n### Solution: To solve the problem of summing the polynomials \\(2x + 3\\) and \\(3x\\), we can follow these steps:\n\n1. Define the polynomials.\n2. Sum the polynomials.\n3. Simplify the resulting polynomial expression.\n\nLet's implement this in Python using the sympy library.\n\n```python\nimport sympy as sp\n\n# Define the variable\nx = sp.symbols('x')\n\n# Define the polynomials\npoly1 = 2*x + 3\npoly2 = 3*x\n\n# Sum the polynomials\nsum_poly = poly1 + poly2\n\n# Simplify the resulting polynomial\nsimplified_sum_poly = sp.simplify(sum_poly)\n\n# Print the simplified polynomial\nprint(simplified_sum_poly)\n```\n```output\n5*x + 3\n```\nThe sum of the polynomials \\(2x + 3\\) and \\(3x\\) is \\(\\boxed{5x + 3}\\).\n"
|
| 22 |
+
|
| 23 |
+
return text
|
| 24 |
+
input_text = model_prompt + question
|
| 25 |
input_tokens = tokenizer.tokenize(input_text)
|
| 26 |
results = generator.generate_batch(
|
| 27 |
[input_tokens],
|