muryshev commited on
Commit
b58e42f
1 Parent(s): ec658c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -12,7 +12,7 @@ def format_prompt(message, history):
12
  return prompt
13
 
14
  def generate(
15
- prompt, history=[], temperature=0.2, max_new_tokens=35000, top_p=0.95, repetition_penalty=1.0,
16
  ):
17
  temperature = float(temperature)
18
  if temperature < 1e-2:
@@ -46,7 +46,8 @@ def health():
46
  def search_route():
47
  data = request.get_json()
48
  prompt = data.get('prompt', '')
49
- return Response(generate(prompt), content_type='text/plain', status=200, direct_passthrough=True)
 
50
 
51
  if __name__ == '__main__':
52
  app.run(debug=False, host='0.0.0.0', port=7860)
 
12
  return prompt
13
 
14
  def generate(
15
+ prompt, history=[], temperature=0.2, max_new_tokens=2000, top_p=0.95, repetition_penalty=1.0,
16
  ):
17
  temperature = float(temperature)
18
  if temperature < 1e-2:
 
46
  def search_route():
47
  data = request.get_json()
48
  prompt = data.get('prompt', '')
49
+ truncated_prompt = original_prompt[:32768]
50
+ return Response(generate(truncated_prompt), content_type='text/plain', status=200, direct_passthrough=True)
51
 
52
  if __name__ == '__main__':
53
  app.run(debug=False, host='0.0.0.0', port=7860)