john commited on
Commit
0b0f7fe
1 Parent(s): 897a3df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -7,14 +7,15 @@ import random
7
  url = 'https://huggingface.co/TheBloke/WizardLM-7B-uncensored-GGML/resolve/main/WizardLM-7B-uncensored.ggmlv3.q2_K.bin'
8
  filename = wget.download(url)
9
  llm2 = Llama(model_path=filename, seed=random.randint(1, 2**31))
 
10
  theme = gr.themes.Soft(
11
  primary_hue=gr.themes.Color("#ededed", "#fee2e2", "#fecaca", "#fca5a5", "#f87171", "#ef4444", "#dc2626", "#b91c1c", "#991b1b", "#7f1d1d", "#6c1e1e"),
12
  neutral_hue="red",
13
  )
14
- title = """<h1 align="center">Chat with awesome WizardLM model!</h1><br>"""
15
  with gr.Blocks(theme=theme) as demo:
16
  gr.HTML(title)
17
- gr.HTML("This model is awesome for its size! It's 20 times smaller than ChatGPT but seems to be very smart. However, this model like all models, can output factually incorrect information. Please do not rely on it for high stakes decisions.")
18
  chatbot = gr.Chatbot()
19
  msg = gr.Textbox()
20
  clear = gr.ClearButton([msg, chatbot])
@@ -29,9 +30,9 @@ with gr.Blocks(theme=theme) as demo:
29
  #token1 = llm.tokenize(b"### Instruction: ")
30
  #token2 = llm.tokenize(instruction.encode())
31
  #token3 = llm2.tokenize(b"USER: ")
32
- tokens5 = llm2.tokenize(user_message.encode())
33
  token4 = llm2.tokenize(b"\n\n### Response:")
34
- tokens = tokens5 + token4
35
  history[-1][1] = ""
36
  count = 0
37
  output = ""
@@ -52,3 +53,4 @@ with gr.Blocks(theme=theme) as demo:
52
 
53
  demo.queue()
54
  demo.launch(debug=True)
 
 
7
  url = 'https://huggingface.co/TheBloke/WizardLM-7B-uncensored-GGML/resolve/main/WizardLM-7B-uncensored.ggmlv3.q2_K.bin'
8
  filename = wget.download(url)
9
  llm2 = Llama(model_path=filename, seed=random.randint(1, 2**31))
10
+ filename = wget.download(url)
11
  theme = gr.themes.Soft(
12
  primary_hue=gr.themes.Color("#ededed", "#fee2e2", "#fecaca", "#fca5a5", "#f87171", "#ef4444", "#dc2626", "#b91c1c", "#991b1b", "#7f1d1d", "#6c1e1e"),
13
  neutral_hue="red",
14
  )
15
+ title = """<h1 align="center">Chat with awesome WizardLM 7b model!</h1><br>"""
16
  with gr.Blocks(theme=theme) as demo:
17
  gr.HTML(title)
18
+ gr.HTML("This model is awesome for its size! It is only 20th the size of Chatgpt but is around 90% as good as Chatgpt. However, please don't rely on WizardLM to provide 100% true information as it might be wrong sometimes. ")
19
  chatbot = gr.Chatbot()
20
  msg = gr.Textbox()
21
  clear = gr.ClearButton([msg, chatbot])
 
30
  #token1 = llm.tokenize(b"### Instruction: ")
31
  #token2 = llm.tokenize(instruction.encode())
32
  #token3 = llm2.tokenize(b"USER: ")
33
+ tokens3 = llm2.tokenize(user_message.encode())
34
  token4 = llm2.tokenize(b"\n\n### Response:")
35
+ tokens = tokens3 + token4
36
  history[-1][1] = ""
37
  count = 0
38
  output = ""
 
53
 
54
  demo.queue()
55
  demo.launch(debug=True)
56
+