maulanayyy commited on
Commit
1e2399a
·
verified ·
1 Parent(s): e30d06b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,11 +1,11 @@
1
  import gradio as gr
2
  import torch
3
- from transformers import T5Tokenizer, T5ForConditionalGeneration
4
 
5
  # Load the model and tokenizer
6
  model_name = "maulanayyy/codet5_code_translation" # Ganti dengan nama model yang benar
7
- tokenizer = T5Tokenizer.from_pretrained(model_name)
8
- model = T5ForConditionalGeneration.from_pretrained(model_name).to("cuda")
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):