Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ if not os.path.exists(MODEL_PATH):
|
|
17 |
|
18 |
llm = Llama(
|
19 |
model_path=MODEL_PATH,
|
20 |
-
n_ctx=4096,
|
21 |
n_threads=2,
|
22 |
n_threads_batch=2,
|
23 |
verbose=False,
|
@@ -38,7 +38,8 @@ def generate_response(message, history, system_prompt, max_tokens, temperature,
|
|
38 |
top_p=top_p,
|
39 |
echo=False,
|
40 |
)
|
41 |
-
|
|
|
42 |
|
43 |
with gr.Blocks() as iface:
|
44 |
system_prompt_input = gr.Textbox(
|
@@ -50,7 +51,7 @@ with gr.Blocks() as iface:
|
|
50 |
label="Max Tokens",
|
51 |
minimum=32,
|
52 |
maximum=4096,
|
53 |
-
value=
|
54 |
step=32,
|
55 |
)
|
56 |
temperature_slider = gr.Slider(
|
|
|
17 |
|
18 |
llm = Llama(
|
19 |
model_path=MODEL_PATH,
|
20 |
+
n_ctx=4096,
|
21 |
n_threads=2,
|
22 |
n_threads_batch=2,
|
23 |
verbose=False,
|
|
|
38 |
top_p=top_p,
|
39 |
echo=False,
|
40 |
)
|
41 |
+
history.append({"role": "assistant", "content": output["choices"][0]["text"].strip()})
|
42 |
+
return history, history
|
43 |
|
44 |
with gr.Blocks() as iface:
|
45 |
system_prompt_input = gr.Textbox(
|
|
|
51 |
label="Max Tokens",
|
52 |
minimum=32,
|
53 |
maximum=4096,
|
54 |
+
value=1024,
|
55 |
step=32,
|
56 |
)
|
57 |
temperature_slider = gr.Slider(
|