burtenshaw HF Staff commited on
Commit
9a8c7e2
·
verified ·
1 Parent(s): fa7335c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -22,11 +22,11 @@ tokenizer, model = load_model()
22
 
23
 
24
  @spaces.GPU
25
- def generate(message, history):
26
- conversation = history + [message]
 
 
27
 
28
- print(conversation)
29
-
30
  inputs = tokenizer.apply_chat_template(
31
  conversation,
32
  add_generation_prompt=True,
@@ -46,4 +46,4 @@ def generate(message, history):
46
 
47
 
48
  demo = gr.ChatInterface(fn=generate, type="messages", examples=["hello", "hola", "merhaba"], title="NanoChat")
49
- demo.launch()
 
22
 
23
 
24
  @spaces.GPU
25
+ def generate(prompt, history):
26
+ conversation = [
27
+ {"role": "user", "content": prompt},
28
+ ]
29
 
 
 
30
  inputs = tokenizer.apply_chat_template(
31
  conversation,
32
  add_generation_prompt=True,
 
46
 
47
 
48
  demo = gr.ChatInterface(fn=generate, type="messages", examples=["hello", "hola", "merhaba"], title="NanoChat")
49
+ demo.launch()