trashchenkov commited on
Commit
22483c1
·
verified ·
1 Parent(s): 94a6a46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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][0].response_metadata['token_usage']['prompt_tokens']
130
- completion_tokens_a = answer1[a][0].response_metadata['token_usage']['completion_tokens']
131
- total_tokens_a = answer1[a][0].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][0].response_metadata['token_usage']['prompt_tokens']
136
- completion_tokens += answer1[a][0].response_metadata['token_usage']['completion_tokens']
137
- total_tokens += answer1[a][0].response_metadata['token_usage']['total_tokens']
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