ashioyajotham commited on
Commit
de81baf
1 Parent(s): cabdd14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -1,5 +1,12 @@
 
1
  fine_tuned_model = "ashioyajotham/results"
2
 
 
 
 
 
 
 
3
  def generate_code(input_text):
4
  inputs = tokenizer.encode(input_text, return_tensors='pt')
5
  # Use your fine-tuned model to generate code here
 
1
+ from transformers import AutoModelForCausalLM, AutoTokenizer
2
  fine_tuned_model = "ashioyajotham/results"
3
 
4
+ # Load the tokenizer for the Falcon 7B model with remote code trust
5
+ tokenizer = AutoTokenizer.from_pretrained(fine_tuned_model, trust_remote_code=True)
6
+
7
+ # Set the padding token to be the same as the end-of-sequence token
8
+ tokenizer.pad_token = tokenizer.eos_token
9
+
10
  def generate_code(input_text):
11
  inputs = tokenizer.encode(input_text, return_tensors='pt')
12
  # Use your fine-tuned model to generate code here