PolyakovK commited on
Commit
3191631
1 Parent(s): a455c03
Files changed (2) hide show
  1. app.py +0 -2
  2. pages/recommendations.py +3 -0
app.py CHANGED
@@ -1,8 +1,6 @@
1
  import streamlit as st
2
  import pandas as pd
3
- import os
4
  st.set_page_config(page_title="Custom Button Example", layout="wide")
5
- credentials = os.getenv('API_KEY')
6
 
7
 
8
  st.title('Рекомендация книг на основе пользовательского промта')
 
1
  import streamlit as st
2
  import pandas as pd
 
3
  st.set_page_config(page_title="Custom Button Example", layout="wide")
 
4
 
5
 
6
  st.title('Рекомендация книг на основе пользовательского промта')
pages/recommendations.py CHANGED
@@ -6,6 +6,7 @@ from sentence_transformers import util
6
  from sentence_transformers import SentenceTransformer, util
7
  import os
8
  st.set_page_config(page_title="Custom Button Example", layout="wide")
 
9
 
10
  from langchain.chat_models.gigachat import GigaChat
11
  from langchain.prompts.chat import (
@@ -13,6 +14,8 @@ from langchain.prompts.chat import (
13
  HumanMessagePromptTemplate,
14
  SystemMessagePromptTemplate,
15
  )
 
 
16
  credentials = os.getenv('API_KEY')
17
  chat = GigaChat(model='GigaChat', credentials=credentials, verify_ssl_certs=False)
18
 
 
6
  from sentence_transformers import SentenceTransformer, util
7
  import os
8
  st.set_page_config(page_title="Custom Button Example", layout="wide")
9
+ from dotenv import load_dotenv
10
 
11
  from langchain.chat_models.gigachat import GigaChat
12
  from langchain.prompts.chat import (
 
14
  HumanMessagePromptTemplate,
15
  SystemMessagePromptTemplate,
16
  )
17
+
18
+ load_dotenv()
19
  credentials = os.getenv('API_KEY')
20
  chat = GigaChat(model='GigaChat', credentials=credentials, verify_ssl_certs=False)
21