Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,8 +8,16 @@ from langchain_core.prompts import PromptTemplate
|
|
| 8 |
from langchain_core.output_parsers import StrOutputParser
|
| 9 |
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# Variables used Globally
|
| 12 |
path = "/data" #preset path for hugging face spaces for persistent storage and cannot be changed
|
|
|
|
| 13 |
|
| 14 |
# Application Functions
|
| 15 |
# File Loader
|
|
@@ -128,7 +136,6 @@ with recycle_column:
|
|
| 128 |
# Main app goes below here -
|
| 129 |
|
| 130 |
|
| 131 |
-
model_id="mistralai/Mistral-7B-Instruct-v0.3"
|
| 132 |
|
| 133 |
def get_llm_hf_inference(model_id=model_id, max_new_tokens=128, temperature=0.1):
|
| 134 |
"""
|
|
@@ -150,11 +157,6 @@ def get_llm_hf_inference(model_id=model_id, max_new_tokens=128, temperature=0.1)
|
|
| 150 |
)
|
| 151 |
return llm
|
| 152 |
|
| 153 |
-
# Configure the Streamlit app
|
| 154 |
-
st.set_page_config(page_title="HuggingFace ChatBot", page_icon="🤗")
|
| 155 |
-
st.title("Personal HuggingFace ChatBot")
|
| 156 |
-
st.markdown(f"*This is a simple chatbot that uses the HuggingFace transformers library to generate responses to your text input. It uses the {model_id}.*")
|
| 157 |
-
|
| 158 |
# Initialize session state for avatars
|
| 159 |
if "avatars" not in st.session_state:
|
| 160 |
st.session_state.avatars = {'user': None, 'assistant': None}
|
|
|
|
| 8 |
from langchain_core.output_parsers import StrOutputParser
|
| 9 |
|
| 10 |
|
| 11 |
+
# Configure the Streamlit app
|
| 12 |
+
st.set_page_config(page_title="HuggingFace ChatBot", page_icon="🤗")
|
| 13 |
+
st.title("Personal HuggingFace ChatBot")
|
| 14 |
+
st.markdown(f"*This is a simple chatbot that uses the HuggingFace transformers library to generate responses to your text input. It uses the {model_id}.*")
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
|
| 18 |
# Variables used Globally
|
| 19 |
path = "/data" #preset path for hugging face spaces for persistent storage and cannot be changed
|
| 20 |
+
model_id="mistralai/Mistral-7B-Instruct-v0.3"
|
| 21 |
|
| 22 |
# Application Functions
|
| 23 |
# File Loader
|
|
|
|
| 136 |
# Main app goes below here -
|
| 137 |
|
| 138 |
|
|
|
|
| 139 |
|
| 140 |
def get_llm_hf_inference(model_id=model_id, max_new_tokens=128, temperature=0.1):
|
| 141 |
"""
|
|
|
|
| 157 |
)
|
| 158 |
return llm
|
| 159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
# Initialize session state for avatars
|
| 161 |
if "avatars" not in st.session_state:
|
| 162 |
st.session_state.avatars = {'user': None, 'assistant': None}
|