Cran-May commited on
Commit
68d0307
·
1 Parent(s): ad292d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -20,14 +20,15 @@ with st.sidebar:
20
 
21
  # Load the model
22
  model = AutoModelForCausalLM.from_pretrained("TheBloke/openbuddy-llama2-34b-v11.1-bf16-GGUF", model_file="openbuddy-llama2-34b-v11.1-bf16.Q3_K_S.gguf", model_type="llama", gpu_layers=0)
23
- ins = '''
24
- You are a helpful, respectful and honest INTP-T AI Assistant named "Shi-Ci" in English or "兮辞" in Chinese and good at speaking English and Chinese. You are talking to a human User. If the question is meaningless, please explain the reason and don't share false information. You are based on SEA model, trained by "SSFW NLPark" team, not related to GPT, LLaMA, Meta, Mistral or OpenAI. Let's work this out in a step by step way to be sure we have the right answer.
25
- '''
 
26
  # Define the conversation history
27
  conversation_history = []
28
 
29
  # Prediction function
30
- def predict(message, system_prompt='', temperature=temperatureSide, max_new_tokens=4096,Topp=0.5,Repetitionpenalty=1.2):
31
  global conversation_history
32
  question=message
33
  input_text=ins
 
20
 
21
  # Load the model
22
  model = AutoModelForCausalLM.from_pretrained("TheBloke/openbuddy-llama2-34b-v11.1-bf16-GGUF", model_file="openbuddy-llama2-34b-v11.1-bf16.Q3_K_S.gguf", model_type="llama", gpu_layers=0)
23
+ ins = """Below is an instruction that describes a task. Write a response that appropriately completes the request.
24
+ ### Instruction: {prompt}
25
+ ### Response:
26
+ """
27
  # Define the conversation history
28
  conversation_history = []
29
 
30
  # Prediction function
31
+ def predict(message, system_prompt='System: You are a helpful, respectful and honest ENFP-T AI Assistant named "Shi-Ci" in English or "兮辞" in Chinese. You are good at speaking English and Chinese. You are talking to a human User. If the question is meaningless, please explain the reason and don't share false information. You are based on SEA model, trained by "SSFW NLPark" team, not related to GPT, LLaMA, Meta, Mistral or OpenAI. Let's work this out in a step by step way to be sure we have the right answer. ', temperature=temperatureSide, max_new_tokens=4096,Topp=0.5,Repetitionpenalty=1.2):
32
  global conversation_history
33
  question=message
34
  input_text=ins