eddyejembi commited on
Commit
6fafc47
·
1 Parent(s): 678c7c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,9 +2,10 @@ import transformers
2
  from transformers import AutoTokenizer
3
  import torch
4
  from transformers import pipeline
 
5
 
6
  model = "meta-llama/Llama-2-7b-chat-hf"
7
- tokenizer = AutoTokenizer.from_pretrained(model, use_auth_token=True)
8
 
9
  SYSTEM_PROMPT = """<s>[INST] <<SYS>>
10
  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.
@@ -56,6 +57,5 @@ def llama_response(message: str, history: list) -> str:
56
  print("Chatbot:", response.strip())
57
  return response.strip()
58
 
59
- import gradio as gr
60
 
61
  gr.ChatInterface(llama_response).launch()
 
2
  from transformers import AutoTokenizer
3
  import torch
4
  from transformers import pipeline
5
+ import gradio as gr
6
 
7
  model = "meta-llama/Llama-2-7b-chat-hf"
8
+ tokenizer = AutoTokenizer.from_pretrained(model, use_auth_token=False)
9
 
10
  SYSTEM_PROMPT = """<s>[INST] <<SYS>>
11
  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.
 
57
  print("Chatbot:", response.strip())
58
  return response.strip()
59
 
 
60
 
61
  gr.ChatInterface(llama_response).launch()