feat: Add requirements

pull/65/head
Zack 1 year ago
parent 8e2b17e28a
commit 97eccb857e

@ -23,6 +23,7 @@ classifiers = [
[tool.poetry.dependencies]
python = "^3.8.1"
revChatGPT = "*"
transformers = "*"
openai = "*"
langchain = "*"

@ -1,5 +1,6 @@
# faiss-gpu
transformers
revChatGPT
pandas
langchain
nest_asyncio

@ -1,24 +1,29 @@
import os
import revChatGPT
from revChatGPT.V1 import Chatbot as RevChatGPTV1
from revChatGPT.V1 import Chatbot as RevChatGPTV1, time
from revChatGPT.V3 import Chatbot as RevChatGPTV3
from abc import ABC, abstractmethod
from revChatGPT.V1 import Chatbot
class RevChatGPTModel:
def __init__(self, access_token=None, api_key=None, **kwargs):
def __init__(self, access_token=None, **kwargs):
super().__init__()
self.config = kwargs
if access_token:
self.chatbot = RevChatGPTV1(config={"access_token": access_token})
elif api_key:
self.chatbot = RevChatGPTV3(api_key=api_key)
self.chatbot = Chatbot(config={"access_token": access_token})
else:
raise ValueError("Either access_token or api_key must be provided.")
raise ValueError("access_token must be provided.")
def run(self, task: str) -> str:
response = ""
self.start_time = time.time()
prev_text = ""
for data in self.chatbot.ask(task):
response = data["message"]
return response
message = data["message"][len(prev_text):]
prev_text = data["message"]
self.end_time = time.time()
return prev_text
def generate_summary(self, text: str) -> str:
# Implement summary generation using RevChatGPT
# Implement this method based on your requirements
pass

Loading…
Cancel
Save