eddyejembi commited on
Commit
e4f8800
·
1 Parent(s): fc7304b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -8,6 +8,13 @@ model = "meta-llama/Llama-2-7b-chat-hf"
8
  access_token = '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'
9
  tokenizer = AutoTokenizer.from_pretrained(model, token=access_token)
10
 
 
 
 
 
 
 
 
11
  SYSTEM_PROMPT = """<s>[INST] <<SYS>>
12
  You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
13
 
 
8
  access_token = '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'
9
  tokenizer = AutoTokenizer.from_pretrained(model, token=access_token)
10
 
11
+ pipeline = transformers.pipeline(
12
+ "text-generation",
13
+ model=model,
14
+ torch_dtype=torch.float16,
15
+ device_map="auto",
16
+ )
17
+
18
  SYSTEM_PROMPT = """<s>[INST] <<SYS>>
19
  You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
20