muryshev commited on
Commit
5fc0130
1 Parent(s): e96f2b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -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=2000, top_p=0.95, repetition_penalty=1.0,
16
  ):
17
  temperature = float(temperature)
18
  if temperature < 1e-2:
@@ -46,7 +46,7 @@ def health():
46
  def search_route():
47
  data = request.get_json()
48
  prompt = data.get('prompt', '')
49
-
50
 
51
  if __name__ == '__main__':
52
  app.run(debug=False, host='0.0.0.0', port=7860, threaded=False)
 
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
+ 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, threaded=False)