Manofem commited on
Commit
c66f552
·
verified ·
1 Parent(s): 74753f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -5,11 +5,10 @@ from ctransformers import AutoModelForCausalLM
5
  # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
6
  llm = AutoModelForCausalLM.from_pretrained("TheBloke/WizardLM-7B-uncensored-GGUF", model_file="WizardLM-7B-uncensored.Q4_K_M.gguf", model_type="llama", stream=True)
7
 
8
-
9
  def generate_response(message):
10
-
11
- for text in llm(message):
12
- yield text
13
 
14
 
15
  def chatbot(message, history):
 
5
  # Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
6
  llm = AutoModelForCausalLM.from_pretrained("TheBloke/WizardLM-7B-uncensored-GGUF", model_file="WizardLM-7B-uncensored.Q4_K_M.gguf", model_type="llama", stream=True)
7
 
 
8
  def generate_response(message):
9
+ tokens = llm(message)
10
+ response_sentence = ' '.join(tokens)
11
+ yield response_sentence
12
 
13
 
14
  def chatbot(message, history):