Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,10 +27,8 @@ def llm_pipeline():
|
|
| 27 |
'text2text-generation',
|
| 28 |
model = base_model,
|
| 29 |
tokenizer = tokenizer,
|
| 30 |
-
max_length =
|
| 31 |
-
|
| 32 |
-
temperature = 0.5,
|
| 33 |
-
top_p= 0.95
|
| 34 |
)
|
| 35 |
local_llm = HuggingFacePipeline(pipeline=pipe)
|
| 36 |
return local_llm
|
|
@@ -74,7 +72,7 @@ def main():
|
|
| 74 |
"""
|
| 75 |
)
|
| 76 |
|
| 77 |
-
|
| 78 |
|
| 79 |
# Initialize session state for generated responses and past messages
|
| 80 |
if "generated" not in st.session_state:
|
|
@@ -91,9 +89,8 @@ def main():
|
|
| 91 |
|
| 92 |
# Display conversation history using Streamlit messages
|
| 93 |
if st.session_state["generated"]:
|
| 94 |
-
display_conversation(st.session_state)
|
| 95 |
|
| 96 |
-
d = """
|
| 97 |
user_input = st.text_input("Question:", placeholder="Ask about your PDF", key='input')
|
| 98 |
with st.form(key='my_form', clear_on_submit=True):
|
| 99 |
submit_button = st.form_submit_button(label='Send')
|
|
@@ -112,7 +109,7 @@ d = """
|
|
| 112 |
st.session_state['generated'].append(answer)
|
| 113 |
|
| 114 |
if st.session_state["generated"]:
|
| 115 |
-
display_conversation(st.session_state)
|
| 116 |
|
| 117 |
|
| 118 |
if __name__ == '__main__':
|
|
|
|
| 27 |
'text2text-generation',
|
| 28 |
model = base_model,
|
| 29 |
tokenizer = tokenizer,
|
| 30 |
+
max_length = 500,
|
| 31 |
+
temperature = 0.5
|
|
|
|
|
|
|
| 32 |
)
|
| 33 |
local_llm = HuggingFacePipeline(pipeline=pipe)
|
| 34 |
return local_llm
|
|
|
|
| 72 |
"""
|
| 73 |
)
|
| 74 |
|
| 75 |
+
d = """ user_input = st.text_input("", key="input")
|
| 76 |
|
| 77 |
# Initialize session state for generated responses and past messages
|
| 78 |
if "generated" not in st.session_state:
|
|
|
|
| 89 |
|
| 90 |
# Display conversation history using Streamlit messages
|
| 91 |
if st.session_state["generated"]:
|
| 92 |
+
display_conversation(st.session_state)"""
|
| 93 |
|
|
|
|
| 94 |
user_input = st.text_input("Question:", placeholder="Ask about your PDF", key='input')
|
| 95 |
with st.form(key='my_form', clear_on_submit=True):
|
| 96 |
submit_button = st.form_submit_button(label='Send')
|
|
|
|
| 109 |
st.session_state['generated'].append(answer)
|
| 110 |
|
| 111 |
if st.session_state["generated"]:
|
| 112 |
+
display_conversation(st.session_state)
|
| 113 |
|
| 114 |
|
| 115 |
if __name__ == '__main__':
|