thobuiq commited on
Commit
bb85ff8
1 Parent(s): dc76d14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -10,7 +10,7 @@ llm = AutoModelForCausalLM.from_pretrained("TheBloke/Mistral-7B-Instruct-v0.1-GG
10
  temperature=0.7,
11
  gpu_layers=0,
12
  stream=True,
13
- threads=int(os.cpu_count() / 2),
14
  max_new_tokens=10000)
15
 
16
 
@@ -23,8 +23,10 @@ def predict(message, history):
23
  for item in history_transformer_format])
24
 
25
  prompt = f"[INST]{messages}[/INST]"
 
26
  for text in llm(prompt=prompt):
27
- yield text
 
28
 
29
  # Setting up the Gradio chat interface.
30
  gr.ChatInterface(predict,
 
10
  temperature=0.7,
11
  gpu_layers=0,
12
  stream=True,
13
+ threads=int(os.cpu_count()),
14
  max_new_tokens=10000)
15
 
16
 
 
23
  for item in history_transformer_format])
24
 
25
  prompt = f"[INST]{messages}[/INST]"
26
+ message_out = ""
27
  for text in llm(prompt=prompt):
28
+ message_out += text
29
+ yield message_out
30
 
31
  # Setting up the Gradio chat interface.
32
  gr.ChatInterface(predict,