Update app.py
Browse files
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 |
-
|
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 = [
|
|
|
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 = [
|