Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,9 @@ import torch
|
|
3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
4 |
|
5 |
# Load the fine-tuned model and tokenizer
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
tokenizer = AutoTokenizer.from_pretrained(tokenizer_path)
|
10 |
|
11 |
# Function to generate Python code from LaTeX expression
|
12 |
def generate_code(latex_expr, tokenizer, model, max_length=512):
|
|
|
3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
4 |
|
5 |
# Load the fine-tuned model and tokenizer
|
6 |
+
model_repo_path = 'sabssag/Latex_to_Python_T5-small'
|
7 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(model_repo_path)
|
8 |
+
tokenizer = AutoTokenizer.from_pretrained(model_repo_path)
|
|
|
9 |
|
10 |
# Function to generate Python code from LaTeX expression
|
11 |
def generate_code(latex_expr, tokenizer, model, max_length=512):
|