ayan4m1 commited on
Commit
97b4c79
·
1 Parent(s): 546bdb2

fix: return a chat object

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -12,14 +12,19 @@ def respond(
12
  top_p: float,
13
  top_k: int
14
  ):
15
- yield [pipe(
16
- message,
17
- max_new_tokens=max_new_tokens,
18
- do_sample=True,
19
- temperature=temperature,
20
- top_p=top_p,
21
- top_k=top_k
22
- )['generated_text']]
 
 
 
 
 
23
 
24
 
25
  """
 
12
  top_p: float,
13
  top_k: int
14
  ):
15
+ yield [
16
+ {
17
+ "role": "assistant",
18
+ "content": pipe(
19
+ message,
20
+ max_new_tokens=max_new_tokens,
21
+ do_sample=True,
22
+ temperature=temperature,
23
+ top_p=top_p,
24
+ top_k=top_k
25
+ )['generated_text']
26
+ }
27
+ ]
28
 
29
 
30
  """