Update app.py
Browse files
app.py
CHANGED
|
@@ -59,6 +59,7 @@ def main():
|
|
| 59 |
text_path = st.sidebar.text_input("Text File Path", "text.txt")
|
| 60 |
quantization = st.sidebar.checkbox("Enable Quantization (4-bit)", value=False)
|
| 61 |
show_context = st.sidebar.checkbox("Show Retrieved Context", value=False)
|
|
|
|
| 62 |
|
| 63 |
# Load the model with the above configuration
|
| 64 |
rag_chain = load_model(
|
|
@@ -74,6 +75,7 @@ def main():
|
|
| 74 |
hf_token=None, # If you're not using HF API token, set it to None
|
| 75 |
max_new_tokens=max_new_tokens,
|
| 76 |
quantization=quantization,
|
|
|
|
| 77 |
)
|
| 78 |
|
| 79 |
st.write("### Enter your question:")
|
|
|
|
| 59 |
text_path = st.sidebar.text_input("Text File Path", "text.txt")
|
| 60 |
quantization = st.sidebar.checkbox("Enable Quantization (4-bit)", value=False)
|
| 61 |
show_context = st.sidebar.checkbox("Show Retrieved Context", value=False)
|
| 62 |
+
offload_dir = st.sidebar.text_input("Offload Directory", "/tmp") # Default to /tmp
|
| 63 |
|
| 64 |
# Load the model with the above configuration
|
| 65 |
rag_chain = load_model(
|
|
|
|
| 75 |
hf_token=None, # If you're not using HF API token, set it to None
|
| 76 |
max_new_tokens=max_new_tokens,
|
| 77 |
quantization=quantization,
|
| 78 |
+
offload_dir=offload_dir, # Pass offload dir here
|
| 79 |
)
|
| 80 |
|
| 81 |
st.write("### Enter your question:")
|