VinitT commited on
Commit
ced0893
·
verified ·
1 Parent(s): 6868991

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -15,7 +15,12 @@ try:
15
  model = PeftModel.from_pretrained(base_model, fine_tuned_model_name)
16
 
17
  print("Loading tokenizer...")
18
- tokenizer = AutoTokenizer.from_pretrained(base_model_name)
 
 
 
 
 
19
 
20
  except Exception as e:
21
  print(f"Error loading the model or tokenizer: {e}")
 
15
  model = PeftModel.from_pretrained(base_model, fine_tuned_model_name)
16
 
17
  print("Loading tokenizer...")
18
+ try:
19
+ tokenizer = AutoTokenizer.from_pretrained(base_model_name)
20
+ except Exception as e:
21
+ print(f"Failed to load tokenizer for {base_model_name}: {e}")
22
+ print("Falling back to a generic tokenizer...")
23
+ tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-1.3B")
24
 
25
  except Exception as e:
26
  print(f"Error loading the model or tokenizer: {e}")