Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
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 |
|