wahdie commited on
Commit
2119593
·
1 Parent(s): af9896b

Configure application file

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. requirements.txt +2 -2
app.py CHANGED
@@ -4,7 +4,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM # Mengimpor tokeni
4
  # 1. Load tokenizer dan model dari HuggingFace Hub
5
  model_name = "wahdie11/text2py2" # Ganti dengan path ke model Anda di HuggingFace Hub
6
  tokenizer = AutoTokenizer.from_pretrained(model_name)
7
- model = AutoModelForCausalLM.from_pretrained(model_name)
8
 
9
  # 2. Definisikan fungsi untuk menghasilkan kode dari input teks
10
  def generate_code(prompt):
 
4
  # 1. Load tokenizer dan model dari HuggingFace Hub
5
  model_name = "wahdie11/text2py2" # Ganti dengan path ke model Anda di HuggingFace Hub
6
  tokenizer = AutoTokenizer.from_pretrained(model_name)
7
+ model = AutoModelForCausalLM.from_pretrained(model_name, ignore_mismatched_sizes=True)
8
 
9
  # 2. Definisikan fungsi untuk menghasilkan kode dari input teks
10
  def generate_code(prompt):
requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
- transformers>=4.0.0
2
- torch
3
  gradio
 
1
+ transformers>=4.31.0
2
+ torch>=2.0.0
3
  gradio