mudogruer commited on
Commit
53dd4da
1 Parent(s): 1797ab3

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -42,6 +42,11 @@ phi2 = pipeline(
42
  )
43
 
44
  def generate(message, max_new_tokens):
 
 
 
 
 
45
  instruction = "You are a helpful assistant to 'User'. You do not respond as 'User' or pretend to be 'User'. You only respond once as 'Assistant'."
46
  final_prompt = f"Instruction: {instruction}\nUser: {message}\nOutput:"
47
 
 
42
  )
43
 
44
  def generate(message, max_new_tokens):
45
+
46
+ # Provide a default value if max_new_tokens is None
47
+ if max_new_tokens is None:
48
+ max_new_tokens = 50 # Default value; adjust as needed based on your typical use case
49
+
50
  instruction = "You are a helpful assistant to 'User'. You do not respond as 'User' or pretend to be 'User'. You only respond once as 'Assistant'."
51
  final_prompt = f"Instruction: {instruction}\nUser: {message}\nOutput:"
52