Sarath0x8f commited on
Commit
dcf800f
1 Parent(s): dca9086

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -69,7 +69,7 @@ file_extractor = {
69
 
70
  # Embedding model and index initialization (to be populated by uploaded files)
71
  # embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-small-en-v1.5") ## Works good
72
- embed_model1 = HuggingFaceEmbedding(model_name="BAAI/bge-large-en") ## works good
73
  # embed_model2 = HuggingFaceEmbedding(model_name="NeuML/pubmedbert-base-embeddings") ## works good
74
 
75
  # sentence-transformers/distilbert-base-nli-mean-tokens
@@ -133,18 +133,18 @@ def respond(message, history):
133
  with gr.Blocks() as demo:
134
  with gr.Row():
135
  with gr.Column(scale=1):
136
- file_input = gr.File(file_count="single", type='filepath')
137
  with gr.Row():
138
  clear = gr.ClearButton()
139
  btn = gr.Button("Submit", variant='primary')
140
  output = gr.Text(label='Vector Index')
141
- model_dropdown = gr.Dropdown(models, label="Select Model", interactive=True)
142
 
143
  with gr.Column(scale=3):
144
  gr.ChatInterface(
145
  fn=respond,
146
  chatbot=gr.Chatbot(height=500),
147
- textbox=gr.Textbox(placeholder="Ask me questions on the uploaded document!", container=False, scale=7)
148
  )
149
 
150
  # Set up Gradio interactions
 
69
 
70
  # Embedding model and index initialization (to be populated by uploaded files)
71
  # embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-small-en-v1.5") ## Works good
72
+ embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-large-en") ## works good
73
  # embed_model2 = HuggingFaceEmbedding(model_name="NeuML/pubmedbert-base-embeddings") ## works good
74
 
75
  # sentence-transformers/distilbert-base-nli-mean-tokens
 
133
  with gr.Blocks() as demo:
134
  with gr.Row():
135
  with gr.Column(scale=1):
136
+ file_input = gr.File(file_count="single", type='filepath', label="Step-1: Upload document")
137
  with gr.Row():
138
  clear = gr.ClearButton()
139
  btn = gr.Button("Submit", variant='primary')
140
  output = gr.Text(label='Vector Index')
141
+ model_dropdown = gr.Dropdown(models, label="Step-2: Select Model", interactive=True)
142
 
143
  with gr.Column(scale=3):
144
  gr.ChatInterface(
145
  fn=respond,
146
  chatbot=gr.Chatbot(height=500),
147
+ textbox=gr.Textbox(placeholder="Step-3: Ask me questions on the uploaded document!", container=False, scale=7)
148
  )
149
 
150
  # Set up Gradio interactions