Skip to content

Commit

Permalink
Fix CI issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-plus committed Mar 29, 2024
1 parent c043545 commit 02b6b22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions openlrc/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (C) 2024. Hao Zheng
# All rights reserved.

import gc
import re
import subprocess
import time
Expand Down Expand Up @@ -74,7 +73,6 @@ def get_audio_duration(path: Union[str, Path]) -> float:


def release_memory(model: torch.nn.Module) -> None:
gc.collect()
torch.cuda.empty_cache()
del model

Expand Down
10 changes: 7 additions & 3 deletions tests/test_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@
from openlrc.chatbot import GPTBot, ClaudeBot


class OpenAIUsage(BaseModel):
class Usage(BaseModel):
pass


class OpenAIUsage(Usage):
prompt_tokens: int
completion_tokens: int
total_tokens: int


class AnthropicUsage(BaseModel):
class AnthropicUsage(Usage):
input_tokens: int
output_tokens: int


class OpenAIResponse(BaseModel):
usage: Union[OpenAIUsage | AnthropicUsage]
usage: Union[Usage]


class TestGPTBot(unittest.TestCase):
Expand Down

0 comments on commit 02b6b22

Please sign in to comment.