Spaces:
Runtime error
Runtime error
Commit Β·
408b072
1
Parent(s): 3cd1b56
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import base64
|
| 2 |
import os
|
| 3 |
-
|
| 4 |
-
|
| 5 |
from langchain.embeddings.openai import OpenAIEmbeddings
|
| 6 |
import streamlit as st
|
| 7 |
from langchain.chains import RetrievalQA
|
|
@@ -15,7 +15,7 @@ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline
|
|
| 15 |
import torch
|
| 16 |
|
| 17 |
st.set_page_config(layout="wide")
|
| 18 |
-
|
| 19 |
|
| 20 |
def process_answer(instruction, qa_chain):
|
| 21 |
response = ''
|
|
@@ -105,7 +105,7 @@ def display_conversation(history):
|
|
| 105 |
|
| 106 |
def main():
|
| 107 |
# Add a sidebar for model selection
|
| 108 |
-
model_options = [
|
| 109 |
selected_model = st.sidebar.selectbox("Select Model", model_options)
|
| 110 |
|
| 111 |
st.markdown("<h1 style='text-align: center; color: blue;'>Custom PDF Chatbot π¦π </h1>", unsafe_allow_html=True)
|
|
|
|
| 1 |
import base64
|
| 2 |
import os
|
| 3 |
+
|
| 4 |
+
|
| 5 |
from langchain.embeddings.openai import OpenAIEmbeddings
|
| 6 |
import streamlit as st
|
| 7 |
from langchain.chains import RetrievalQA
|
|
|
|
| 15 |
import torch
|
| 16 |
|
| 17 |
st.set_page_config(layout="wide")
|
| 18 |
+
|
| 19 |
|
| 20 |
def process_answer(instruction, qa_chain):
|
| 21 |
response = ''
|
|
|
|
| 105 |
|
| 106 |
def main():
|
| 107 |
# Add a sidebar for model selection
|
| 108 |
+
model_options = ["MBZUAI/LaMini-T5-738M", "google/flan-t5-base", "google/flan-t5-small"]
|
| 109 |
selected_model = st.sidebar.selectbox("Select Model", model_options)
|
| 110 |
|
| 111 |
st.markdown("<h1 style='text-align: center; color: blue;'>Custom PDF Chatbot π¦π </h1>", unsafe_allow_html=True)
|