Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
-
from transformers import
|
| 4 |
|
| 5 |
# Load the model and tokenizer
|
| 6 |
model_name = "maulanayyy/codet5_code_translation" # Ganti dengan nama model yang benar
|
| 7 |
-
tokenizer =
|
| 8 |
-
model =
|
| 9 |
|
| 10 |
# Function to perform inference
|
| 11 |
def translate_code(input_code):
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 4 |
|
| 5 |
# Load the model and tokenizer
|
| 6 |
model_name = "maulanayyy/codet5_code_translation" # Ganti dengan nama model yang benar
|
| 7 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 8 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
| 9 |
|
| 10 |
# Function to perform inference
|
| 11 |
def translate_code(input_code):
|