add del for memory cleanup
Browse files- handler.py +8 -3
handler.py
CHANGED
@@ -437,21 +437,26 @@ class EndpointHandler():
|
|
437 |
uptake_speaker = params.pop("uptake_speaker", None)
|
438 |
uptake_model.run_inference(transcript, min_prev_words=params['uptake_min_num_words'],
|
439 |
uptake_speaker=uptake_speaker)
|
|
|
|
|
440 |
# Reasoning
|
441 |
reasoning_model = ReasoningModel(
|
442 |
self.device, self.tokenizer, self.input_builder)
|
443 |
reasoning_model.run_inference(transcript, uptake_speaker=uptake_speaker)
|
444 |
-
|
|
|
445 |
# Question
|
446 |
question_model = QuestionModel(
|
447 |
self.device, self.tokenizer, self.input_builder)
|
448 |
question_model.run_inference(transcript)
|
449 |
-
|
|
|
450 |
# Focusing Question
|
451 |
focusing_question_model = FocusingQuestionModel(
|
452 |
self.device, self.tokenizer, self.input_builder)
|
453 |
focusing_question_model.run_inference(transcript, uptake_speaker=uptake_speaker)
|
454 |
-
|
|
|
455 |
math_cloud = run_math_density(transcript)
|
456 |
transcript.update_utterance_roles(uptake_speaker)
|
457 |
transcript.calculate_aggregate_word_count()
|
|
|
437 |
uptake_speaker = params.pop("uptake_speaker", None)
|
438 |
uptake_model.run_inference(transcript, min_prev_words=params['uptake_min_num_words'],
|
439 |
uptake_speaker=uptake_speaker)
|
440 |
+
del uptake_model
|
441 |
+
|
442 |
# Reasoning
|
443 |
reasoning_model = ReasoningModel(
|
444 |
self.device, self.tokenizer, self.input_builder)
|
445 |
reasoning_model.run_inference(transcript, uptake_speaker=uptake_speaker)
|
446 |
+
del reasoning_model
|
447 |
+
|
448 |
# Question
|
449 |
question_model = QuestionModel(
|
450 |
self.device, self.tokenizer, self.input_builder)
|
451 |
question_model.run_inference(transcript)
|
452 |
+
del question_model
|
453 |
+
|
454 |
# Focusing Question
|
455 |
focusing_question_model = FocusingQuestionModel(
|
456 |
self.device, self.tokenizer, self.input_builder)
|
457 |
focusing_question_model.run_inference(transcript, uptake_speaker=uptake_speaker)
|
458 |
+
del focusing_question_model
|
459 |
+
|
460 |
math_cloud = run_math_density(transcript)
|
461 |
transcript.update_utterance_roles(uptake_speaker)
|
462 |
transcript.calculate_aggregate_word_count()
|