Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ from langchain.chains import ConversationalRetrievalChain
|
|
11 |
from htmlTemplates import css, bot_template, user_template
|
12 |
from langchain.llms import HuggingFaceHub
|
13 |
from deep_translator import GoogleTranslator
|
14 |
-
|
15 |
# set this key as an environment variable
|
16 |
os.environ["HUGGINGFACEHUB_API_TOKEN"] = st.secrets['huggingface_token']
|
17 |
###########################################################################################
|
@@ -142,6 +142,17 @@ def main():
|
|
142 |
|
143 |
|
144 |
with st.sidebar:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
st.subheader("Your documents")
|
146 |
pdf_docs = st.file_uploader(
|
147 |
"Upload your PDFs here and click on 'Process'", accept_multiple_files=True)
|
@@ -163,6 +174,7 @@ def main():
|
|
163 |
#compelete build model
|
164 |
st.write("compelete build model")
|
165 |
|
|
|
166 |
if __name__ == "__main__":
|
167 |
main()
|
168 |
|
|
|
11 |
from htmlTemplates import css, bot_template, user_template
|
12 |
from langchain.llms import HuggingFaceHub
|
13 |
from deep_translator import GoogleTranslator
|
14 |
+
import pandas as pd
|
15 |
# set this key as an environment variable
|
16 |
os.environ["HUGGINGFACEHUB_API_TOKEN"] = st.secrets['huggingface_token']
|
17 |
###########################################################################################
|
|
|
142 |
|
143 |
|
144 |
with st.sidebar:
|
145 |
+
# تعریف یک لیست خالی برای ذخیره رکوردها
|
146 |
+
records = []
|
147 |
+
# اضافه کردن ورودیها در Streamlit
|
148 |
+
element_a = st.text_input('عنصر اول را وارد کنید')
|
149 |
+
element_b = st.text_input('عنصر دوم را وارد کنید')
|
150 |
+
# دکمه برای اضافه کردن رکورد به لیست و ذخیره در فایل اکسل
|
151 |
+
if st.button('ذخیره رکورد'):
|
152 |
+
records.append({'A': element_a, 'B': element_b})
|
153 |
+
df = pd.DataFrame(records)
|
154 |
+
df.to_excel('output.xlsx', index=False)
|
155 |
+
st.success('رکورد با موفقیت ذخیره شد!')
|
156 |
st.subheader("Your documents")
|
157 |
pdf_docs = st.file_uploader(
|
158 |
"Upload your PDFs here and click on 'Process'", accept_multiple_files=True)
|
|
|
174 |
#compelete build model
|
175 |
st.write("compelete build model")
|
176 |
|
177 |
+
|
178 |
if __name__ == "__main__":
|
179 |
main()
|
180 |
|