Ajaykanth Maddi commited on
Commit ·
253cc8c
1
Parent(s): 185c971
Question UI Changes
Browse files
app.py
CHANGED
|
@@ -2,23 +2,9 @@ import gradio as gr
|
|
| 2 |
import matplotlib.pyplot as plt
|
| 3 |
import json
|
| 4 |
import logging
|
| 5 |
-
from pathlib import Path
|
| 6 |
-
import time
|
| 7 |
-
import random
|
| 8 |
-
import re
|
| 9 |
-
import math
|
| 10 |
-
from dataclasses import dataclass
|
| 11 |
-
from typing import List, Dict, Tuple
|
| 12 |
-
from datetime import datetime
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
# === Data Handling ===
|
| 16 |
-
import numpy as np
|
| 17 |
-
import pandas as pd
|
| 18 |
|
|
|
|
| 19 |
|
| 20 |
-
import shutil
|
| 21 |
-
import tiktoken # For token counting
|
| 22 |
|
| 23 |
# ==== Metrics Calculation
|
| 24 |
from sklearn.metrics import roc_auc_score
|
|
@@ -26,15 +12,6 @@ from sklearn.metrics import mean_squared_error
|
|
| 26 |
|
| 27 |
# === HuggingFace & Transformers ===
|
| 28 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
| 29 |
-
from datasets import load_dataset
|
| 30 |
-
from sentence_transformers import SentenceTransformer, CrossEncoder, util
|
| 31 |
-
|
| 32 |
-
from langchain_huggingface import HuggingFaceEmbeddings
|
| 33 |
-
from langchain.vectorstores import FAISS
|
| 34 |
-
from langchain.prompts import PromptTemplate
|
| 35 |
-
from langchain.chains import RetrievalQA
|
| 36 |
-
from langchain.schema import Document as LangchainDocument
|
| 37 |
-
from langchain_huggingface import HuggingFacePipeline
|
| 38 |
|
| 39 |
|
| 40 |
# === Misc ===
|
|
@@ -359,7 +336,7 @@ with gr.Blocks(
|
|
| 359 |
chunking_strategies_plot = gr.Plot()
|
| 360 |
|
| 361 |
with gr.Row():
|
| 362 |
-
question_dropdown = gr.Dropdown(choices=available_questions[initial_subset], label="📋 Predefined Questions", interactive=True)
|
| 363 |
custom_question_input = gr.Textbox(label="✍️ Custom Question (optional)")
|
| 364 |
|
| 365 |
|
|
|
|
| 2 |
import matplotlib.pyplot as plt
|
| 3 |
import json
|
| 4 |
import logging
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
from datetime import datetime
|
| 7 |
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# ==== Metrics Calculation
|
| 10 |
from sklearn.metrics import roc_auc_score
|
|
|
|
| 12 |
|
| 13 |
# === HuggingFace & Transformers ===
|
| 14 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
# === Misc ===
|
|
|
|
| 336 |
chunking_strategies_plot = gr.Plot()
|
| 337 |
|
| 338 |
with gr.Row():
|
| 339 |
+
question_dropdown = gr.Dropdown(choices=available_questions[initial_subset], multiselect=True, filterable=True, label="📋 Predefined Questions", interactive=True)
|
| 340 |
custom_question_input = gr.Textbox(label="✍️ Custom Question (optional)")
|
| 341 |
|
| 342 |
|