tmzh commited on
Commit
86b6d09
1 Parent(s): 37e3c71

fix gr update

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -29,7 +29,8 @@ models = {
29
  model_name = "Mistral-7B"
30
 
31
  tokenizer = AutoTokenizer.from_pretrained(models[model_name])
32
-
 
33
 
34
  model = AutoModelForCausalLM.from_pretrained(models[model_name],
35
  torch_dtype=torch.float16,
@@ -103,7 +104,7 @@ def respond(query):
103
  answer = answer.replace('</s>', '')
104
  samples = related_questions
105
 
106
- related = gr.Dataset.update(samples=related_questions)
107
 
108
  yield [answer, references, related]
109
 
 
29
  model_name = "Mistral-7B"
30
 
31
  tokenizer = AutoTokenizer.from_pretrained(models[model_name])
32
+ # tokenizer.use_default_system_prompt = True
33
+ tokenizer.chat_template = tokenizer.default_chat_template
34
 
35
  model = AutoModelForCausalLM.from_pretrained(models[model_name],
36
  torch_dtype=torch.float16,
 
104
  answer = answer.replace('</s>', '')
105
  samples = related_questions
106
 
107
+ related = gr.update(samples=related_questions)
108
 
109
  yield [answer, references, related]
110