Spaces:
Runtime error
Runtime error
yentinglin
commited on
Commit
•
55029ff
1
Parent(s):
9077757
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import os
|
|
2 |
|
3 |
import gradio as gr
|
4 |
from text_generation import Client
|
5 |
-
from conversation import
|
6 |
from transformers import AutoTokenizer
|
7 |
from pymongo import MongoClient
|
8 |
|
@@ -141,7 +141,7 @@ with gr.Blocks() as demo:
|
|
141 |
|
142 |
|
143 |
def bot(history, max_new_tokens, temperature, top_p, top_k, system_prompt):
|
144 |
-
conv =
|
145 |
roles = {"human": conv.roles[0], "gpt": conv.roles[1]} # map human to USER and gpt to ASSISTANT
|
146 |
conv.system = system_prompt
|
147 |
for user, bot in history:
|
|
|
2 |
|
3 |
import gradio as gr
|
4 |
from text_generation import Client
|
5 |
+
from conversation import get_conv_template
|
6 |
from transformers import AutoTokenizer
|
7 |
from pymongo import MongoClient
|
8 |
|
|
|
141 |
|
142 |
|
143 |
def bot(history, max_new_tokens, temperature, top_p, top_k, system_prompt):
|
144 |
+
conv = get_conv_template("twllm_v2").copy()
|
145 |
roles = {"human": conv.roles[0], "gpt": conv.roles[1]} # map human to USER and gpt to ASSISTANT
|
146 |
conv.system = system_prompt
|
147 |
for user, bot in history:
|