gabrielaltay commited on
Commit
eae1702
1 Parent(s): fe9941d
Files changed (2) hide show
  1. app.py +13 -5
  2. requirements.txt +17 -2
app.py CHANGED
@@ -28,7 +28,7 @@ from langchain_community.embeddings import HuggingFaceBgeEmbeddings
28
  from langchain_community.vectorstores.utils import DistanceStrategy
29
  from langchain_openai import ChatOpenAI
30
  from langchain_anthropic import ChatAnthropic
31
- from langchain_nvidia_ai_endpoints import ChatNVIDIA
32
  from langchain_pinecone import PineconeVectorStore
33
  from pinecone import Pinecone
34
  import streamlit as st
@@ -65,11 +65,19 @@ ANTHROPIC_CHAT_MODELS = [
65
  "claude-3-5-sonnet-20240620",
66
  "claude-3-opus-20240229",
67
  ]
68
- CHAT_MODELS = OPENAI_CHAT_MODELS + ANTHROPIC_CHAT_MODELS
 
 
 
 
 
 
 
69
 
70
  PROVIDER_MODELS = {
71
  "OpenAI": OPENAI_CHAT_MODELS,
72
  "Anthropic": ANTHROPIC_CHAT_MODELS,
 
73
  }
74
 
75
 
@@ -503,14 +511,14 @@ elif SS["model_name"] in ANTHROPIC_CHAT_MODELS:
503
  top_p=SS["top_p"],
504
  max_tokens_to_sample=SS["max_output_tokens"],
505
  )
506
- elif SS["model_name"] in NVIDIA_NIM_CHAT_MODELS:
507
- llm = ChatNVIDIA(
508
  model=SS["model_name"],
509
  temperature=SS["temperature"],
510
  max_tokens=SS["max_output_tokens"],
511
  top_p=SS["top_p"],
512
  seed=SEED,
513
- nvidia_api_key=st.secrets["nvidia_api_key"],
514
  )
515
  else:
516
  raise ValueError()
 
28
  from langchain_community.vectorstores.utils import DistanceStrategy
29
  from langchain_openai import ChatOpenAI
30
  from langchain_anthropic import ChatAnthropic
31
+ from langchain_together import ChatTogether
32
  from langchain_pinecone import PineconeVectorStore
33
  from pinecone import Pinecone
34
  import streamlit as st
 
65
  "claude-3-5-sonnet-20240620",
66
  "claude-3-opus-20240229",
67
  ]
68
+ TOGETHER_CHAT_MODELS = [
69
+ "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
70
+ "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
71
+ "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
72
+ ]
73
+
74
+
75
+ CHAT_MODELS = OPENAI_CHAT_MODELS + ANTHROPIC_CHAT_MODELS + TOGETHER_CHAT_MODELS
76
 
77
  PROVIDER_MODELS = {
78
  "OpenAI": OPENAI_CHAT_MODELS,
79
  "Anthropic": ANTHROPIC_CHAT_MODELS,
80
+ "Together": TOGETHER_CHAT_MODELS,
81
  }
82
 
83
 
 
511
  top_p=SS["top_p"],
512
  max_tokens_to_sample=SS["max_output_tokens"],
513
  )
514
+ elif SS["model_name"] in TOGETHER_CHAT_MODELS:
515
+ llm = ChatTogether(
516
  model=SS["model_name"],
517
  temperature=SS["temperature"],
518
  max_tokens=SS["max_output_tokens"],
519
  top_p=SS["top_p"],
520
  seed=SEED,
521
+ api_key=st.secrets["together_api_key"],
522
  )
523
  else:
524
  raise ValueError()
requirements.txt CHANGED
@@ -28,6 +28,7 @@ frozenlist==1.4.1
28
  fsspec==2024.2.0
29
  gitdb==4.0.11
30
  GitPython==3.1.42
 
31
  h11==0.14.0
32
  httpcore==1.0.4
33
  httpx==0.27.0
@@ -46,11 +47,12 @@ jsonschema-specifications==2023.12.1
46
  langchain==0.2.5
47
  langchain-anthropic==0.1.15
48
  langchain-community==0.2.5
49
- langchain-core==0.2.7
50
  langchain-nvidia-ai-endpoints==0.1.2
51
- langchain-openai==0.1.8
52
  langchain-pinecone==0.1.1
53
  langchain-text-splitters==0.2.1
 
54
  langchainhub==0.1.15
55
  langsmith==0.1.77
56
  markdown-it-py==3.0.0
@@ -63,6 +65,18 @@ multidict==6.0.5
63
  mypy-extensions==1.0.0
64
  networkx==3.2.1
65
  numpy==1.26.4
 
 
 
 
 
 
 
 
 
 
 
 
66
  openai==1.34.0
67
  orjson==3.10.0
68
  packaging==23.2
@@ -115,6 +129,7 @@ tornado==6.4
115
  tqdm==4.66.2
116
  traitlets==5.14.1
117
  transformers==4.38.1
 
118
  types-requests==2.31.0.20240311
119
  typing-inspect==0.9.0
120
  typing_extensions==4.9.0
 
28
  fsspec==2024.2.0
29
  gitdb==4.0.11
30
  GitPython==3.1.42
31
+ greenlet==3.0.3
32
  h11==0.14.0
33
  httpcore==1.0.4
34
  httpx==0.27.0
 
47
  langchain==0.2.5
48
  langchain-anthropic==0.1.15
49
  langchain-community==0.2.5
50
+ langchain-core==0.2.28
51
  langchain-nvidia-ai-endpoints==0.1.2
52
+ langchain-openai==0.1.20
53
  langchain-pinecone==0.1.1
54
  langchain-text-splitters==0.2.1
55
+ langchain-together==0.1.5
56
  langchainhub==0.1.15
57
  langsmith==0.1.77
58
  markdown-it-py==3.0.0
 
65
  mypy-extensions==1.0.0
66
  networkx==3.2.1
67
  numpy==1.26.4
68
+ nvidia-cublas-cu12==12.1.3.1
69
+ nvidia-cuda-cupti-cu12==12.1.105
70
+ nvidia-cuda-nvrtc-cu12==12.1.105
71
+ nvidia-cuda-runtime-cu12==12.1.105
72
+ nvidia-cudnn-cu12==8.9.2.26
73
+ nvidia-cufft-cu12==11.0.2.54
74
+ nvidia-curand-cu12==10.3.2.106
75
+ nvidia-cusolver-cu12==11.4.5.107
76
+ nvidia-cusparse-cu12==12.1.0.106
77
+ nvidia-nccl-cu12==2.19.3
78
+ nvidia-nvjitlink-cu12==12.6.20
79
+ nvidia-nvtx-cu12==12.1.105
80
  openai==1.34.0
81
  orjson==3.10.0
82
  packaging==23.2
 
129
  tqdm==4.66.2
130
  traitlets==5.14.1
131
  transformers==4.38.1
132
+ triton==2.2.0
133
  types-requests==2.31.0.20240311
134
  typing-inspect==0.9.0
135
  typing_extensions==4.9.0