rphrp1985 commited on
Commit
8e94850
·
verified ·
1 Parent(s): 2d9088a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -73,11 +73,12 @@ def respond(
73
  temperature,
74
  top_p,
75
  ):
76
- model= model.to('cuda')
77
  messages = [{"role": "user", "content": "Hello, how are you?"}]
78
  input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to('cuda')
79
  ## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
80
  # with autocast():
 
81
  gen_tokens = model.generate(
82
  input_ids,
83
  max_new_tokens=100,
 
73
  temperature,
74
  top_p,
75
  ):
76
+
77
  messages = [{"role": "user", "content": "Hello, how are you?"}]
78
  input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to('cuda')
79
  ## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
80
  # with autocast():
81
+ model= model.to('cuda')
82
  gen_tokens = model.generate(
83
  input_ids,
84
  max_new_tokens=100,