Update app.py
Browse files
app.py
CHANGED
|
@@ -114,7 +114,7 @@ def talk(prompt, history):
|
|
| 114 |
# the chat template structure should be based on text generation model format
|
| 115 |
|
| 116 |
# indicates the end of a sequence
|
| 117 |
-
stream = model.create_chat_completion(messages = messages, max_tokens=1000, stop=["</s>"], stream=
|
| 118 |
# print(f"{stream}")
|
| 119 |
print("check 7")
|
| 120 |
# print(stream['choices'][0]['message']['content'])
|
|
@@ -135,17 +135,7 @@ def talk(prompt, history):
|
|
| 135 |
# only the tokens comprising the top_p probability mass are considered for responses
|
| 136 |
# This output is a data structure containing all the information returned by generate(), but that can also be used as tuple or dictionary.
|
| 137 |
|
| 138 |
-
|
| 139 |
-
# NUM_TOKENS=0
|
| 140 |
-
|
| 141 |
-
# time_generate = time.time() - start
|
| 142 |
-
# print('\n')
|
| 143 |
-
# print('-'*4+'End Generation'+'-'*4)
|
| 144 |
-
# print(f'Num of generated tokens: {NUM_TOKENS}')
|
| 145 |
-
# print(f'Time for complete generation: {time_generate}s')
|
| 146 |
-
# print(f'Tokens per secound: {NUM_TOKENS/time_generate}')
|
| 147 |
-
# print(f'Time per token: {(time_generate/NUM_TOKENS)*1000}ms')
|
| 148 |
-
|
| 149 |
|
| 150 |
TITLE = "AI Copilot for Diabetes Patients"
|
| 151 |
|
|
|
|
| 114 |
# the chat template structure should be based on text generation model format
|
| 115 |
|
| 116 |
# indicates the end of a sequence
|
| 117 |
+
stream = model.create_chat_completion(messages = messages, max_tokens=1000, stop=["</s>"], stream=False)
|
| 118 |
# print(f"{stream}")
|
| 119 |
print("check 7")
|
| 120 |
# print(stream['choices'][0]['message']['content'])
|
|
|
|
| 135 |
# only the tokens comprising the top_p probability mass are considered for responses
|
| 136 |
# This output is a data structure containing all the information returned by generate(), but that can also be used as tuple or dictionary.
|
| 137 |
|
| 138 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
|
| 140 |
TITLE = "AI Copilot for Diabetes Patients"
|
| 141 |
|