rphrp1985 commited on
Commit
dbfa4f4
1 Parent(s): 0b0a8fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -107,21 +107,21 @@ def respond(
107
  print(f"Converted input_ids dtype: {input_ids.dtype}")
108
  input_str= str(input_ids2)
109
  print('input str = ', input_str)
110
- ## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
111
- # with autocast():
112
- gen_tokens = model.generate(
113
- input_ids,
114
- max_new_tokens=max_tokens,
115
- # do_sample=True,
116
- temperature=temperature,
117
- )
118
-
119
- gen_text = tokenizer.decode(gen_tokens[0])
120
- print(gen_text)
121
- gen_text= gen_text.replace(input_str,'')
122
- gen_text= gen_text.replace('<|END_OF_TURN_TOKEN|>','')
123
 
124
- yield gen_text
125
 
126
 
127
  # messages = [
 
107
  print(f"Converted input_ids dtype: {input_ids.dtype}")
108
  input_str= str(input_ids2)
109
  print('input str = ', input_str)
110
+
111
+
112
+ # gen_tokens = model.generate(
113
+ # input_ids,
114
+ # max_new_tokens=max_tokens,
115
+ # # do_sample=True,
116
+ # temperature=temperature,
117
+ # )
118
+
119
+ # gen_text = tokenizer.decode(gen_tokens[0])
120
+ # print(gen_text)
121
+ # gen_text= gen_text.replace(input_str,'')
122
+ # gen_text= gen_text.replace('<|END_OF_TURN_TOKEN|>','')
123
 
124
+ # yield gen_text
125
 
126
 
127
  # messages = [