Spaces:
Runtime error
Runtime error
Update getans.py
Browse files
getans.py
CHANGED
@@ -1,15 +1,9 @@
|
|
1 |
-
from mmap import mmap
|
2 |
-
|
3 |
import torch
|
4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
5 |
-
|
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 |
-
|
11 |
-
|
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")
|