|
import streamlit as st |
|
import openai |
|
import tiktoken |
|
from openai.embeddings_utils import get_embedding, cosine_similarity |
|
import torch |
|
from sentence_transformers import SentenceTransformer, util |
|
|
|
|
|
st.set_page_config(page_title="App", layout="wide") |
|
|
|
st.title("HAL UNIV-COTEDAZUR Collection Semantic Search") |
|
|
|
model_options = st.sidebar.selectbox("Choose the free embeddings model to use ?", ('all-MiniLM-L6-v2', 'multi-qa-mpnet-base-dot-v1')) |
|
|
|
if ok_openai := st.sidebar.checkbox('You want to use the OpenAI Embeddings too'): |
|
if openai_api_key := st.text_input( |
|
":blue[Put Your OPENAI API-KEY :]", |
|
placeholder="Paste your OpenAI API key here ", |
|
type="password", |
|
): |
|
st.success("great") |
|
|
|
col1, col2 = st.columns(2) |
|
if query := st.text_input( |
|
":orange[Enter your question :]"): |
|
with col1: |
|
st.write("OpenAI place") |
|
with col2: |
|
st.write("Open LLM place") |
|
|