Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,7 @@ def stream_chat(
|
|
| 46 |
message: str,
|
| 47 |
history: list,
|
| 48 |
temperature: float = 0.3,
|
| 49 |
-
max_new_tokens: int =
|
| 50 |
top_p: float = 1.0,
|
| 51 |
top_k: int = 20,
|
| 52 |
penalty: float = 1.2,
|
|
@@ -54,7 +54,7 @@ def stream_chat(
|
|
| 54 |
print(f'message: {message}')
|
| 55 |
print(f'history: {history}')
|
| 56 |
|
| 57 |
-
conversation = []
|
| 58 |
for prompt, answer in history:
|
| 59 |
conversation.extend([
|
| 60 |
{"role": "user", "content": prompt},
|
|
@@ -112,7 +112,7 @@ with gr.Blocks(css=CSS, theme="soft") as demo:
|
|
| 112 |
minimum=128,
|
| 113 |
maximum=4096,
|
| 114 |
step=1,
|
| 115 |
-
value=
|
| 116 |
label="Max new tokens",
|
| 117 |
render=False,
|
| 118 |
),
|
|
|
|
| 46 |
message: str,
|
| 47 |
history: list,
|
| 48 |
temperature: float = 0.3,
|
| 49 |
+
max_new_tokens: int = 256,
|
| 50 |
top_p: float = 1.0,
|
| 51 |
top_k: int = 20,
|
| 52 |
penalty: float = 1.2,
|
|
|
|
| 54 |
print(f'message: {message}')
|
| 55 |
print(f'history: {history}')
|
| 56 |
|
| 57 |
+
conversation = [{"role": "system", "content": "You are EXAONE model from LG AI Research, a helpful assistant."}]
|
| 58 |
for prompt, answer in history:
|
| 59 |
conversation.extend([
|
| 60 |
{"role": "user", "content": prompt},
|
|
|
|
| 112 |
minimum=128,
|
| 113 |
maximum=4096,
|
| 114 |
step=1,
|
| 115 |
+
value=256,
|
| 116 |
label="Max new tokens",
|
| 117 |
render=False,
|
| 118 |
),
|