Akshat1000 commited on
Commit
f97659d
·
verified ·
1 Parent(s): f1b9369

Update getans.py

Browse files
Files changed (1) hide show
  1. getans.py +3 -9
getans.py CHANGED
@@ -1,15 +1,9 @@
1
- from mmap import mmap
2
-
3
  import torch
4
  from transformers import AutoTokenizer, AutoModelForCausalLM
5
- from huggingface_hub import login
6
- token1="hf_"
7
- token2="vWSzjVPShXPbgmylDJduWwHinTfHNqZVpj"
8
- login(token=token1+token2,add_to_git_credential=True)
9
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
10
- mm="finetuning/output/pytorch_model.bin"
11
- tokenizer = AutoTokenizer.from_pretrained(mm)
12
- model = AutoModelForCausalLM.from_pretrained(mm)
13
 
14
  def get_response(prompt, max_new_tokens=50):
15
  inputs = tokenizer(prompt, return_tensors="pt")
 
 
 
1
  import torch
2
  from transformers import AutoTokenizer, AutoModelForCausalLM
3
+
 
 
 
4
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
5
+ tokenizer = AutoTokenizer.from_pretrained("georgesung/llama2_7b_chat_uncensored")
6
+ model = AutoModelForCausalLM.from_pretrained("georgesung/llama2_7b_chat_uncensored")
 
7
 
8
  def get_response(prompt, max_new_tokens=50):
9
  inputs = tokenizer(prompt, return_tensors="pt")