Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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()
|
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 |
-
|
|
|
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,
|