OlivierDehaene commited on
Commit
94809e9
1 Parent(s): 1649c8c

add truncate

Browse files
Files changed (2) hide show
  1. app.py +2 -3
  2. requirements.txt +1 -1
app.py CHANGED
@@ -48,15 +48,14 @@ def predict(
48
  inputs = user_name + inputs
49
 
50
  total_inputs = "".join(past) + inputs + "\n\n" + assistant_name
51
- # truncate total_inputs
52
- total_inputs = total_inputs[-1000:]
53
 
54
  partial_words = ""
55
 
56
  for i, response in enumerate(client.generate_stream(
57
  total_inputs,
58
- top_p=top_p,
59
  top_k=top_k,
 
60
  repetition_penalty=repetition_penalty,
61
  watermark=watermark,
62
  temperature=temperature,
 
48
  inputs = user_name + inputs
49
 
50
  total_inputs = "".join(past) + inputs + "\n\n" + assistant_name
 
 
51
 
52
  partial_words = ""
53
 
54
  for i, response in enumerate(client.generate_stream(
55
  total_inputs,
56
+ top_p=top_p if top_p < 1.0 else None,
57
  top_k=top_k,
58
+ truncate=1000,
59
  repetition_penalty=repetition_penalty,
60
  watermark=watermark,
61
  temperature=temperature,
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- text-generation
2
  gradio==3.20.1
 
1
+ text-generation==0.3.0
2
  gradio==3.20.1