CatoG commited on
Commit
b83e69b
Β·
verified Β·
1 Parent(s): 15f0919

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +80 -83
app.py CHANGED
@@ -14,77 +14,69 @@ import uuid
14
 
15
 
16
  MODEL_OPTIONS = [
17
- "meta-llama/Llama-3.2-3B-Instruct",
18
- "meta-llama/Llama-3.2-1B-Instruct",
19
- "HuggingFaceH4/zephyr-7b-beta",
20
- "meta-llama/Llama-3.1-8B",
21
- "deepseek-ai/DeepSeek-R1",
22
- "meta-llama/Llama-3-8B-Instruct",
23
- "Qwen/Qwen3-8B",
24
- "moonshotai/Kimi-K2-Tinking",
25
- "openai/gpt-oss-20b",
26
- "zai-org/GLM-4.6",
27
- "moonshotai/Kimi-K2-Thinking",
28
- "meta-llama/Llama-3.1-8B-Instruct",
29
  "allenai/Olmo-3-32B-Think",
30
  "allenai/Olmo-3-7B-Instruct",
31
- "openai/gpt-oss-20b",
32
  "allenai/Olmo-3-7B-Think",
33
- "zai-org/GLM-4.6",
34
- "openai/gpt-oss-120b",
35
- "MiniMaxAI/MiniMax-M2",
36
- "meta-llama/Llama-3.2-3B-Instruct",
37
- "Qwen/Qwen2.5-7B-Instruct",
38
- "PrimeIntellect/INTELLECT-3-FP8",
 
 
 
 
39
  "deepseek-ai/DeepSeek-V3.2-Exp",
40
- "Qwen/Qwen3-4B-Instruct-2507",
41
  "dphn/Dolphin-Mistral-24B-Venice-Edition",
 
 
 
 
 
 
 
 
42
  "meta-llama/Llama-3.1-8B",
43
- "Qwen/Qwen3-Next-80B-A3B-Instruct",
44
- "deepseek-ai/DeepSeek-R1",
45
- "Qwen/Qwen3-8B",
46
- "Qwen/Qwen3-Coder-30B-A3B-Instruct",
47
  "meta-llama/Llama-3.2-1B-Instruct",
48
- "moonshotai/Kimi-K2-Instruct",
49
- "nvidia/NVIDIA-Nemotron-Nano-12B-v2",
50
- "meta-llama/Meta-Llama-3-8B-Instruct",
51
  "meta-llama/Llama-3.3-70B-Instruct",
52
- "Qwen/Qwen3-32B",
53
- "HuggingFaceTB/SmolLM3-3B",
54
- "deepseek-ai/DeepSeek-R1-0528-Qwen3-8B",
55
- "zai-org/GLM-4.5-Air",
56
- "Qwen/Qwen3-4B-Thinking-2507",
57
- "moonshotai/Kimi-K2-Instruct-0905",
58
- "Qwen/Qwen3-1.7B",
59
- "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B",
60
- "Qwen/Qwen3-235B-A22B-Instruct-2507",
61
- "Qwen/Qwen3-30B-A3B-Instruct-2507",
62
- "baichuan-inc/Baichuan-M2-32B",
63
- "mistralai/Mistral-7B-Instruct-v0.2",
64
  "meta-llama/Meta-Llama-3-8B",
 
 
 
 
 
 
 
 
 
 
 
65
  "Qwen/Qwen2.5-1.5B-Instruct",
66
- "Qwen/Qwen3-Next-80B-A3B-Thinking",
67
- "deepseek-ai/DeepSeek-V3.1-Terminus",
68
- "HuggingFaceH4/zephyr-7b-beta",
69
- "google/gemma-2-2b-it",
70
- "meta-llama/Llama-Guard-3-8B",
71
- "Qwen/Qwen2.5-Coder-7B-Instruct",
72
- "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B",
73
- "Goekdeniz-Guelmez/Josiefied-Qwen3-8B-abliterated-v1",
74
- "darkc0de/XortronCriminalComputingConfig",
75
- "ArliAI/QwQ-32B-ArliAI-RpR-v4",
76
- "inclusionAI/Ling-1T",
77
- "Gryphe/MythoMax-L2-13b",
78
  "Qwen/Qwen2.5-7B",
 
79
  "Qwen/Qwen2.5-Coder-1.5B-Instruct",
80
- "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B",
81
- "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
82
- "DeepHat/DeepHat-V1-7B",
83
  "Qwen/Qwen3-14B",
84
  "Qwen/Qwen3-30B-A3B",
85
- "Intelligent-Internet/II-Medical-8B",
86
- "zai-org/GLM-4.5",
87
- ]
 
 
 
 
 
 
 
 
 
 
88
 
89
 
90
  # Suppress warnings
@@ -300,41 +292,36 @@ with gr.Blocks(title="QA Bot - PDF Question Answering") as demo:
300
  truncate_slider = gr.Dropdown(
301
  label="Embedding Model",
302
  choices=[
303
- "sentence-transformers/all-MiniLM-L6-v2",
304
- "sentence-transformers/all-mpnet-base-v2",
305
- "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
306
- "BAAI/bge-small-en-v1.5",
307
  "BAAI/bge-base-en-v1.5",
308
- "google/embeddinggemma-300m",
309
- "sentence-transformers/all-MiniLM-L6-v2",
310
  "BAAI/bge-m3",
311
- "Qwen/Qwen3-Embedding-8B",
312
- "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
313
- "MongoDB/mdbr-leaf-mt",
314
- "BAAI/bge-base-en-v1.5",
315
- "intfloat/multilingual-e5-large",
316
- "ai-forever/ru-en-RoSBERTa",
317
  "cointegrated/rubert-tiny2",
318
- "jhgan/ko-sroberta-multitask",
319
- "sentence-transformers/all-mpnet-base-v2",
 
320
  "intfloat/multilingual-e5-small",
 
 
 
321
  "mixedbread-ai/mxbai-embed-xsmall-v1",
322
- "Snowflake/snowflake-arctic-embed-l-v2.0",
323
- "sentence-transformers/LaBSE",
 
 
 
324
  "sentence-transformers/all-MiniLM-L12-v2",
 
 
 
 
 
325
  "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
326
  "shibing624/text2vec-base-chinese",
327
- "intfloat/multilingual-e5-base",
328
- "BAAI/bge-large-en-v1.5",
329
- "BAAI/bge-small-en-v1.5",
330
- "BAAI/bge-base-zh-v1.5",
331
- "mixedbread-ai/mxbai-embed-large-v1",
332
  "Snowflake/snowflake-arctic-embed-m-v1.5",
333
- "lokeshch19/ModernPubMedBERT",
334
- "pritamdeka/S-Biomed-Roberta-snli-multinli-stsb",
335
- "pritamdeka/S-PubMedBert-MS-MARCO",
336
- "sentence-transformers/clip-ViT-B-32-multilingual-v1",
337
- "sentence-transformers/msmarco-MiniLM-L6-v3"
338
  ],
339
  value="sentence-transformers/all-MiniLM-L6-v2",
340
  info="Model used for generating embeddings"
@@ -383,6 +370,16 @@ with gr.Blocks(title="QA Bot - PDF Question Answering") as demo:
383
 
384
  gr.Markdown(
385
  """
 
 
 
 
 
 
 
 
 
 
386
  """
387
  )
388
 
 
14
 
15
 
16
  MODEL_OPTIONS = [
 
 
 
 
 
 
 
 
 
 
 
 
17
  "allenai/Olmo-3-32B-Think",
18
  "allenai/Olmo-3-7B-Instruct",
 
19
  "allenai/Olmo-3-7B-Think",
20
+ "ArliAI/QwQ-32B-ArliAI-RpR-v4",
21
+ "baichuan-inc/Baichuan-M2-32B",
22
+ "darkc0de/XortronCriminalComputingConfig",
23
+ "deepseek-ai/DeepSeek-R1",
24
+ "deepseek-ai/DeepSeek-R1-0528-Qwen3-8B",
25
+ "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B",
26
+ "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B",
27
+ "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
28
+ "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B",
29
+ "deepseek-ai/DeepSeek-V3.1-Terminus",
30
  "deepseek-ai/DeepSeek-V3.2-Exp",
31
+ "DeepHat/DeepHat-V1-7B",
32
  "dphn/Dolphin-Mistral-24B-Venice-Edition",
33
+ "Goekdeniz-Guelmez/Josiefied-Qwen3-8B-abliterated-v1",
34
+ "google/gemma-2-2b-it",
35
+ "Gryphe/MythoMax-L2-13b",
36
+ "HuggingFaceH4/zephyr-7b-beta",
37
+ "HuggingFaceTB/SmolLM3-3B",
38
+ "inclusionAI/Ling-1T",
39
+ "Intelligent-Internet/II-Medical-8B",
40
+ "meta-llama/Llama-3-8B-Instruct",
41
  "meta-llama/Llama-3.1-8B",
42
+ "meta-llama/Llama-3.1-8B-Instruct",
 
 
 
43
  "meta-llama/Llama-3.2-1B-Instruct",
44
+ "meta-llama/Llama-3.2-3B-Instruct",
 
 
45
  "meta-llama/Llama-3.3-70B-Instruct",
46
+ "meta-llama/Llama-Guard-3-8B",
 
 
 
 
 
 
 
 
 
 
 
47
  "meta-llama/Meta-Llama-3-8B",
48
+ "meta-llama/Meta-Llama-3-8B-Instruct",
49
+ "MiniMaxAI/MiniMax-M2",
50
+ "mistralai/Mistral-7B-Instruct-v0.2",
51
+ "moonshotai/Kimi-K2-Instruct",
52
+ "moonshotai/Kimi-K2-Instruct-0905",
53
+ "moonshotai/Kimi-K2-Thinking",
54
+ "moonshotai/Kimi-K2-Tinking",
55
+ "nvidia/NVIDIA-Nemotron-Nano-12B-v2",
56
+ "openai/gpt-oss-120b",
57
+ "openai/gpt-oss-20b",
58
+ "PrimeIntellect/INTELLECT-3-FP8",
59
  "Qwen/Qwen2.5-1.5B-Instruct",
 
 
 
 
 
 
 
 
 
 
 
 
60
  "Qwen/Qwen2.5-7B",
61
+ "Qwen/Qwen2.5-7B-Instruct",
62
  "Qwen/Qwen2.5-Coder-1.5B-Instruct",
63
+ "Qwen/Qwen2.5-Coder-7B-Instruct",
64
+ "Qwen/Qwen3-1.7B",
 
65
  "Qwen/Qwen3-14B",
66
  "Qwen/Qwen3-30B-A3B",
67
+ "Qwen/Qwen3-30B-A3B-Instruct-2507",
68
+ "Qwen/Qwen3-32B",
69
+ "Qwen/Qwen3-4B-Instruct-2507",
70
+ "Qwen/Qwen3-4B-Thinking-2507",
71
+ "Qwen/Qwen3-8B",
72
+ "Qwen/Qwen3-235B-A22B-Instruct-2507",
73
+ "Qwen/Qwen3-Coder-30B-A3B-Instruct",
74
+ "Qwen/Qwen3-Next-80B-A3B-Instruct",
75
+ "Qwen/Qwen3-Next-80B-A3B-Thinking",
76
+ "zai-org/GLM-4.5",
77
+ "zai-org/GLM-4.5-Air",
78
+ "zai-org/GLM-4.6",
79
+ ]
80
 
81
 
82
  # Suppress warnings
 
292
  truncate_slider = gr.Dropdown(
293
  label="Embedding Model",
294
  choices=[
295
+ "ai-forever/ru-en-RoSBERTa",
 
 
 
296
  "BAAI/bge-base-en-v1.5",
297
+ "BAAI/bge-base-zh-v1.5",
298
+ "BAAI/bge-large-en-v1.5",
299
  "BAAI/bge-m3",
300
+ "BAAI/bge-small-en-v1.5",
 
 
 
 
 
301
  "cointegrated/rubert-tiny2",
302
+ "google/embeddinggemma-300m",
303
+ "intfloat/multilingual-e5-base",
304
+ "intfloat/multilingual-e5-large",
305
  "intfloat/multilingual-e5-small",
306
+ "jhgan/ko-sroberta-multitask",
307
+ "lokeshch19/ModernPubMedBERT",
308
+ "mixedbread-ai/mxbai-embed-large-v1",
309
  "mixedbread-ai/mxbai-embed-xsmall-v1",
310
+ "MongoDB/mdbr-leaf-mt",
311
+ "pritamdeka/S-Biomed-Roberta-snli-multinli-stsb",
312
+ "pritamdeka/S-PubMedBert-MS-MARCO",
313
+ "Qwen/Qwen3-Embedding-8B",
314
+ "sentence-transformers/all-MiniLM-L6-v2",
315
  "sentence-transformers/all-MiniLM-L12-v2",
316
+ "sentence-transformers/all-mpnet-base-v2",
317
+ "sentence-transformers/clip-ViT-B-32-multilingual-v1",
318
+ "sentence-transformers/LaBSE",
319
+ "sentence-transformers/msmarco-MiniLM-L6-v3",
320
+ "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
321
  "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
322
  "shibing624/text2vec-base-chinese",
323
+ "Snowflake/snowflake-arctic-embed-l-v2.0",
 
 
 
 
324
  "Snowflake/snowflake-arctic-embed-m-v1.5",
 
 
 
 
 
325
  ],
326
  value="sentence-transformers/all-MiniLM-L6-v2",
327
  info="Model used for generating embeddings"
 
370
 
371
  gr.Markdown(
372
  """
373
+ ### πŸ“ Instructions
374
+ 1. Upload a PDF document
375
+ 2. Enter your question in the text box
376
+ 3. (Optional) Select a different LLM model
377
+ 4. (Optional) Adjust advanced settings for fine-tuning
378
+ 5. Click "Ask Question" to get an answer
379
+
380
+ ### πŸ” Setup
381
+ This Space requires a HuggingFace API token. Set the following in your Space secrets:
382
+ - `HF_TOKEN`: Your HuggingFace API token (get it from https://huggingface.co/settings/tokens)
383
  """
384
  )
385