Spaces:
Running
Running
Johnny Lee
commited on
Commit
·
d5920e8
1
Parent(s):
e123e9b
updates and lock deps
Browse files- .python-version +0 -1
- app.py +6 -5
- requirements.txt +98 -7
.python-version
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
chatgpt-clone
|
|
|
|
|
|
app.py
CHANGED
|
@@ -257,7 +257,7 @@ class ChatSession(BaseModel):
|
|
| 257 |
poll_question_name: Optional[str] = None,
|
| 258 |
use_claude: Optional[bool] = False,
|
| 259 |
) -> ChatPromptTemplate:
|
| 260 |
-
knowledge_cutoff = "Early 2023" if use_claude else "2022-
|
| 261 |
current_date = datetime.datetime.now(
|
| 262 |
pytz.timezone("America/New_York")
|
| 263 |
).strftime("%Y-%m-%d")
|
|
@@ -294,10 +294,10 @@ class ChatSession(BaseModel):
|
|
| 294 |
) -> Tuple[Union[ChatOpenAI, ChatAnthropic], int, tiktoken.tokenizer]:
|
| 295 |
if use_claude:
|
| 296 |
llm = ChatAnthropic(
|
| 297 |
-
model="claude-2",
|
| 298 |
anthropic_api_key=ANTHROPIC_API_KEY,
|
| 299 |
temperature=1,
|
| 300 |
-
max_tokens_to_sample=
|
| 301 |
streaming=True,
|
| 302 |
)
|
| 303 |
context_length = CLAUDE_2_CONTEXT_LENGTH
|
|
@@ -311,6 +311,7 @@ class ChatSession(BaseModel):
|
|
| 311 |
max_retries=6,
|
| 312 |
request_timeout=100,
|
| 313 |
streaming=True,
|
|
|
|
| 314 |
)
|
| 315 |
context_length = GPT_3_5_CONTEXT_LENGTH
|
| 316 |
_, tokenizer = llm._get_encoding_model()
|
|
@@ -608,7 +609,7 @@ async def respond(
|
|
| 608 |
|
| 609 |
|
| 610 |
class ChatbotConfig(BaseModel):
|
| 611 |
-
app_title: str = "CBS Technology Strategy
|
| 612 |
chatbot_modes: List[str] = [
|
| 613 |
ChatbotMode.DEBATE_PARTNER.value,
|
| 614 |
ChatbotMode.RESEARCH_ASSISTANT.value,
|
|
@@ -741,4 +742,4 @@ with gr.Blocks(
|
|
| 741 |
chat_submit_button.click(**clear_chatbot_messages_params)
|
| 742 |
input_message.submit(**clear_chatbot_messages_params)
|
| 743 |
|
| 744 |
-
demo.queue(max_size=25,
|
|
|
|
| 257 |
poll_question_name: Optional[str] = None,
|
| 258 |
use_claude: Optional[bool] = False,
|
| 259 |
) -> ChatPromptTemplate:
|
| 260 |
+
knowledge_cutoff = "Early 2023" if use_claude else "2022-09"
|
| 261 |
current_date = datetime.datetime.now(
|
| 262 |
pytz.timezone("America/New_York")
|
| 263 |
).strftime("%Y-%m-%d")
|
|
|
|
| 294 |
) -> Tuple[Union[ChatOpenAI, ChatAnthropic], int, tiktoken.tokenizer]:
|
| 295 |
if use_claude:
|
| 296 |
llm = ChatAnthropic(
|
| 297 |
+
model="claude-2.1",
|
| 298 |
anthropic_api_key=ANTHROPIC_API_KEY,
|
| 299 |
temperature=1,
|
| 300 |
+
max_tokens_to_sample=2048,
|
| 301 |
streaming=True,
|
| 302 |
)
|
| 303 |
context_length = CLAUDE_2_CONTEXT_LENGTH
|
|
|
|
| 311 |
max_retries=6,
|
| 312 |
request_timeout=100,
|
| 313 |
streaming=True,
|
| 314 |
+
max_tokens=2048,
|
| 315 |
)
|
| 316 |
context_length = GPT_3_5_CONTEXT_LENGTH
|
| 317 |
_, tokenizer = llm._get_encoding_model()
|
|
|
|
| 609 |
|
| 610 |
|
| 611 |
class ChatbotConfig(BaseModel):
|
| 612 |
+
app_title: str = "CBS Technology Strategy"
|
| 613 |
chatbot_modes: List[str] = [
|
| 614 |
ChatbotMode.DEBATE_PARTNER.value,
|
| 615 |
ChatbotMode.RESEARCH_ASSISTANT.value,
|
|
|
|
| 742 |
chat_submit_button.click(**clear_chatbot_messages_params)
|
| 743 |
input_message.submit(**clear_chatbot_messages_params)
|
| 744 |
|
| 745 |
+
demo.queue(max_size=25, api_open=False).launch(auth=auth, max_threads=16)
|
requirements.txt
CHANGED
|
@@ -1,7 +1,98 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
aiofiles==23.2.1
|
| 2 |
+
aiohttp==3.9.1
|
| 3 |
+
aiosignal==1.3.1
|
| 4 |
+
altair==5.2.0
|
| 5 |
+
anthropic==0.8.1
|
| 6 |
+
anyio==4.2.0
|
| 7 |
+
astroid==3.0.2
|
| 8 |
+
async-timeout==4.0.3
|
| 9 |
+
attrs==23.2.0
|
| 10 |
+
cachetools==5.3.2
|
| 11 |
+
certifi==2023.11.17
|
| 12 |
+
charset-normalizer==3.3.2
|
| 13 |
+
click==8.1.7
|
| 14 |
+
contourpy==1.2.0
|
| 15 |
+
cycler==0.12.1
|
| 16 |
+
dataclasses-json==0.6.3
|
| 17 |
+
dill==0.3.7
|
| 18 |
+
distro==1.9.0
|
| 19 |
+
exceptiongroup==1.2.0
|
| 20 |
+
fastapi==0.108.0
|
| 21 |
+
ffmpy==0.3.1
|
| 22 |
+
filelock==3.13.1
|
| 23 |
+
fonttools==4.47.0
|
| 24 |
+
frozenlist==1.4.1
|
| 25 |
+
fsspec==2023.12.2
|
| 26 |
+
google-auth==2.25.2
|
| 27 |
+
google-auth-oauthlib==1.2.0
|
| 28 |
+
gradio==3.50.2
|
| 29 |
+
gradio_client==0.6.1
|
| 30 |
+
gspread==5.12.4
|
| 31 |
+
h11==0.14.0
|
| 32 |
+
httpcore==1.0.2
|
| 33 |
+
httpx==0.26.0
|
| 34 |
+
huggingface-hub==0.20.1
|
| 35 |
+
idna==3.6
|
| 36 |
+
importlib-resources==6.1.1
|
| 37 |
+
isort==5.13.2
|
| 38 |
+
Jinja2==3.1.2
|
| 39 |
+
jsonpatch==1.33
|
| 40 |
+
jsonpointer==2.4
|
| 41 |
+
jsonschema==4.20.0
|
| 42 |
+
jsonschema-specifications==2023.12.1
|
| 43 |
+
kiwisolver==1.4.5
|
| 44 |
+
langchain==0.0.353
|
| 45 |
+
langchain-community==0.0.7
|
| 46 |
+
langchain-core==0.1.4
|
| 47 |
+
langsmith==0.0.77
|
| 48 |
+
MarkupSafe==2.1.3
|
| 49 |
+
marshmallow==3.20.1
|
| 50 |
+
matplotlib==3.8.2
|
| 51 |
+
mccabe==0.7.0
|
| 52 |
+
multidict==6.0.4
|
| 53 |
+
mypy==1.8.0
|
| 54 |
+
mypy-extensions==1.0.0
|
| 55 |
+
numpy==1.26.3
|
| 56 |
+
oauthlib==3.2.2
|
| 57 |
+
openai==1.6.1
|
| 58 |
+
orjson==3.9.10
|
| 59 |
+
packaging==23.2
|
| 60 |
+
pandas==2.1.4
|
| 61 |
+
pillow==10.2.0
|
| 62 |
+
platformdirs==4.1.0
|
| 63 |
+
pyasn1==0.5.1
|
| 64 |
+
pyasn1-modules==0.3.0
|
| 65 |
+
pydantic==1.10.13
|
| 66 |
+
pydub==0.25.1
|
| 67 |
+
pylint==3.0.3
|
| 68 |
+
pyparsing==3.1.1
|
| 69 |
+
python-dateutil==2.8.2
|
| 70 |
+
python-dotenv==1.0.0
|
| 71 |
+
python-multipart==0.0.6
|
| 72 |
+
pytz==2023.3.post1
|
| 73 |
+
PyYAML==6.0.1
|
| 74 |
+
referencing==0.32.0
|
| 75 |
+
regex==2023.12.25
|
| 76 |
+
requests==2.31.0
|
| 77 |
+
requests-oauthlib==1.3.1
|
| 78 |
+
rpds-py==0.16.2
|
| 79 |
+
rsa==4.9
|
| 80 |
+
semantic-version==2.10.0
|
| 81 |
+
six==1.16.0
|
| 82 |
+
sniffio==1.3.0
|
| 83 |
+
SQLAlchemy==2.0.25
|
| 84 |
+
starlette==0.32.0.post1
|
| 85 |
+
tenacity==8.2.3
|
| 86 |
+
tiktoken==0.5.2
|
| 87 |
+
tokenizers==0.15.0
|
| 88 |
+
tomli==2.0.1
|
| 89 |
+
tomlkit==0.12.3
|
| 90 |
+
toolz==0.12.0
|
| 91 |
+
tqdm==4.66.1
|
| 92 |
+
typing-inspect==0.9.0
|
| 93 |
+
typing_extensions==4.9.0
|
| 94 |
+
tzdata==2023.4
|
| 95 |
+
urllib3==2.1.0
|
| 96 |
+
uvicorn==0.25.0
|
| 97 |
+
websockets==11.0.3
|
| 98 |
+
yarl==1.9.4
|