Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -126,15 +126,15 @@ def process_sms():
|
|
126 |
|
127 |
|
128 |
logs += ('### ' + min_sec(start) + f' Ответ {a+1}: ')
|
129 |
-
prompt_tokens_a = answer1[a]
|
130 |
-
completion_tokens_a = answer1[a]
|
131 |
-
total_tokens_a = answer1[a]
|
132 |
logs += f'Токенов промпта: {prompt_tokens_a}'
|
133 |
logs += f'Токенов сгенерировано: {completion_tokens_a}'
|
134 |
logs += f'Токенов всего: {total_tokens_a}'
|
135 |
-
prompt_tokens += answer1[a]
|
136 |
-
completion_tokens += answer1[a]
|
137 |
-
total_tokens += answer1[a]
|
138 |
logs += (f'Сгенерированное сообщение: {answer1[a].content}')
|
139 |
yield logs
|
140 |
|
|
|
126 |
|
127 |
|
128 |
logs += ('### ' + min_sec(start) + f' Ответ {a+1}: ')
|
129 |
+
prompt_tokens_a = answer1[a].response_metadata['token_usage']['prompt_tokens']
|
130 |
+
completion_tokens_a = answer1[a].response_metadata['token_usage']['completion_tokens']
|
131 |
+
total_tokens_a = answer1[a].response_metadata['token_usage']['total_tokens']
|
132 |
logs += f'Токенов промпта: {prompt_tokens_a}'
|
133 |
logs += f'Токенов сгенерировано: {completion_tokens_a}'
|
134 |
logs += f'Токенов всего: {total_tokens_a}'
|
135 |
+
prompt_tokens += answer1[a].response_metadata['token_usage']['prompt_tokens']
|
136 |
+
completion_tokens += answer1[a].response_metadata['token_usage']['completion_tokens']
|
137 |
+
total_tokens += answer1[a].response_metadata['token_usage']['total_tokens']
|
138 |
logs += (f'Сгенерированное сообщение: {answer1[a].content}')
|
139 |
yield logs
|
140 |
|