Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dicklesworthstone committed May 25, 2024
1 parent 4269a2a commit dac4705
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions service_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ async def generate_completion_from_llm(request: TextCompletionRequest, req: Requ
generated_text = model_output['text']
if request.grammar_file_string == 'json':
generated_text = generated_text.encode('unicode_escape').decode()
finish_reason = model_output['finish_reason'],
finish_reason = str(model_output['finish_reason'])
llm_model_usage_json = json.dumps(current_completion_output['usage'])
logger.info(f"Completed text completion {idx:,} in an average of {total_time_per_completion:,.2f} seconds for input prompt: '{request.input_prompt}'; Beginning of generated text: \n'{generated_text[:100]}'...")
response = TextCompletionResponse(input_prompt = request.input_prompt,
Expand Down Expand Up @@ -618,8 +618,9 @@ async def ask_question_about_image(
)
response_time = datetime.utcnow()
total_time_taken = (response_time - request_time).total_seconds()
generated_text = llm_output['choices'][0]['message']['content']
finish_reason = llm_output['choices'][0]['finish_reason']
model_output = llm_output['choices'][0]
generated_text = model_output['message']['content']
finish_reason = str(model_output['finish_reason'])
llm_model_usage_json = json.dumps(llm_output['usage'])
response = ImageQuestionResponse(
question=question,
Expand Down

0 comments on commit dac4705

Please sign in to comment.