Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
8 |
model_repo_path = 'sabssag/Latex_to_Python_T5-small'
|
9 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_repo_path)
|
10 |
tokenizer = AutoTokenizer.from_pretrained(model_repo_path)
|
11 |
-
|
12 |
# Function to generate Python code from LaTeX expression
|
13 |
def generate_code_from_latex(latex_expression, max_length=256):
|
14 |
inputs = tokenizer(f"Latex Expression: {latex_expression} Solution:", return_tensors="pt").to(model.device)
|
|
|
8 |
model_repo_path = 'sabssag/Latex_to_Python_T5-small'
|
9 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_repo_path)
|
10 |
tokenizer = AutoTokenizer.from_pretrained(model_repo_path)
|
11 |
+
model.eval()
|
12 |
# Function to generate Python code from LaTeX expression
|
13 |
def generate_code_from_latex(latex_expression, max_length=256):
|
14 |
inputs = tokenizer(f"Latex Expression: {latex_expression} Solution:", return_tensors="pt").to(model.device)
|