benhaotang commited on
Commit
7046ce9
·
verified ·
1 Parent(s): f058cc0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -33,8 +33,8 @@ def load_model():
33
 
34
  pipe = load_model()
35
 
36
- @spaces.GPU(duration=110)
37
- def generate_response(prompt, max_length=1024):
38
  # Create messages with system prompt
39
  messages = [
40
  {"role": "system", "content": "You are a helpful AI assistant. You always think step by step."},
@@ -42,7 +42,8 @@ def generate_response(prompt, max_length=1024):
42
  ]
43
 
44
  outputs = pipe(messages, max_new_tokens=max_length)
45
-
 
46
  # Extract just the assistant's response
47
  try:
48
  # Get the message list from the output
 
33
 
34
  pipe = load_model()
35
 
36
+ @spaces.GPU(duration=20)
37
+ def generate_response(prompt, max_length=124):
38
  # Create messages with system prompt
39
  messages = [
40
  {"role": "system", "content": "You are a helpful AI assistant. You always think step by step."},
 
42
  ]
43
 
44
  outputs = pipe(messages, max_new_tokens=max_length)
45
+
46
+ print("Raw output:", outputs)
47
  # Extract just the assistant's response
48
  try:
49
  # Get the message list from the output