benhaotang commited on
Commit
a209453
·
verified ·
1 Parent(s): 6c69508

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -26,7 +26,7 @@ def load_model():
26
  model, tokenizer = load_model()
27
 
28
  @spaces.GPU(duration=80) # Added the decorator here
29
- def generate_response(prompt, max_length=2048):
30
  inputs = tokenizer(prompt, return_tensors="pt").to("cuda" if torch.cuda.is_available() else "cpu")
31
  outputs = model.generate(**inputs, max_length=max_length)
32
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)
 
26
  model, tokenizer = load_model()
27
 
28
  @spaces.GPU(duration=80) # Added the decorator here
29
+ def generate_response(prompt, max_length=1024):
30
  inputs = tokenizer(prompt, return_tensors="pt").to("cuda" if torch.cuda.is_available() else "cpu")
31
  outputs = model.generate(**inputs, max_length=max_length)
32
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)