Futuresony commited on
Commit
e4dce1e
·
verified ·
1 Parent(s): 8cb560a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -24,7 +24,7 @@ def fetch_message():
24
  generation_params = {
25
  "temperature": 0.7, # Adjust creativity level
26
  "top_p": 0.9, # Use nucleus sampling
27
- "max_new_tokens": 150, # Limit the response length
28
  "repetition_penalty": 1.1 # Avoid repeating text
29
  }
30
 
@@ -33,7 +33,7 @@ def fetch_message():
33
  response = client.text_generation(message)
34
  return jsonify({"response": response})
35
  except Exception as e:
36
- return jsonify({"error": str(e)}), 500
37
 
38
  if __name__ == "__main__":
39
  # Use PORT environment variable or default to 7860
 
24
  generation_params = {
25
  "temperature": 0.7, # Adjust creativity level
26
  "top_p": 0.9, # Use nucleus sampling
27
+ "max_new_tokens": 700, # Limit the response length
28
  "repetition_penalty": 1.1 # Avoid repeating text
29
  }
30
 
 
33
  response = client.text_generation(message)
34
  return jsonify({"response": response})
35
  except Exception as e:
36
+ return jsonify({"error": str(e)}), 1000
37
 
38
  if __name__ == "__main__":
39
  # Use PORT environment variable or default to 7860