sabssag commited on
Commit
b1f44d7
1 Parent(s): c5b2a7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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)