Update README.md
Browse files
README.md
CHANGED
@@ -1,12 +1,17 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
# Model Card for
|
7 |
|
8 |
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
-
|
10 |
|
11 |
|
12 |
## Model Details
|
@@ -15,23 +20,24 @@ tags: []
|
|
15 |
|
16 |
<!-- Provide a longer summary of what this model is. -->
|
17 |
|
18 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
19 |
|
20 |
-
- **Developed by:**
|
21 |
-
- **Funded by [optional]:**
|
22 |
-
- **
|
23 |
-
- **
|
24 |
-
- **
|
25 |
-
- **
|
26 |
-
|
27 |
|
28 |
### Model Sources [optional]
|
29 |
|
30 |
<!-- Provide the basic links for the model. -->
|
31 |
|
32 |
-
- **Repository:**
|
33 |
-
- **
|
34 |
-
- **
|
|
|
|
|
35 |
|
36 |
## Uses
|
37 |
|
@@ -41,6 +47,24 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
41 |
|
42 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
[More Information Needed]
|
45 |
|
46 |
### Downstream Use [optional]
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- rag
|
5 |
+
- retrieval-augmented-generation
|
6 |
+
- mcqa
|
7 |
+
- qwen3
|
8 |
+
- epfl
|
9 |
---
|
10 |
|
11 |
+
# Model Card for EmaRimoldi/MNLP_M2_rag_model
|
12 |
|
13 |
<!-- Provide a quick summary of what the model is/does. -->
|
14 |
+
#This model is a fine-tuned Retrieval-Augmented Generation (RAG-Sequence) system, built to answer advanced STEM multiple-choice and short-answer questions by retrieving relevant context from a curated EPFL STEM corpus and then generating grounded answers.
|
15 |
|
16 |
|
17 |
## Model Details
|
|
|
20 |
|
21 |
<!-- Provide a longer summary of what this model is. -->
|
22 |
|
|
|
23 |
|
24 |
+
- **Developed by:** Ema Rimoldi (EPFL CS-552 MNLP course)
|
25 |
+
- **Funded by [optional]:** EPFL Natural Language Processing Lab
|
26 |
+
- **Model type:** RAG-Sequence (Retrieval-Augmented Generation)
|
27 |
+
- **Language(s) (NLP):** English
|
28 |
+
- **License:** Apache-2.0
|
29 |
+
- **Finetuned from model [optional]:** Qwen3-0.6B-Base
|
30 |
+
|
31 |
|
32 |
### Model Sources [optional]
|
33 |
|
34 |
<!-- Provide the basic links for the model. -->
|
35 |
|
36 |
+
- **Repository:** https://huggingface.co/EmaRimoldi/MNLP_M2_rag_model
|
37 |
+
- **Dataset:** https://huggingface.co/datasets/EmaRimoldi/MNLP_M2_rag_dataset
|
38 |
+
- **Document encoder:** https://huggingface.co/EmaRimoldi/MNLP_M2_document_encoder
|
39 |
+
- **Retriever index:** FAISS index stored under https://huggingface.co/datasets/EmaRimoldi/MNLP_M2_documents
|
40 |
+
|
41 |
|
42 |
## Uses
|
43 |
|
|
|
47 |
|
48 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
49 |
|
50 |
+
Call the RAG pipeline to ground answers in retrieved EPFL STEM documents:
|
51 |
+
|
52 |
+
```python
|
53 |
+
from transformers import RagTokenizer, RagSequenceForGeneration
|
54 |
+
|
55 |
+
tokenizer = RagTokenizer.from_pretrained("EmaRimoldi/MNLP_M2_rag_model")
|
56 |
+
model = RagSequenceForGeneration.from_pretrained("EmaRimoldi/MNLP_M2_rag_model")
|
57 |
+
|
58 |
+
input_dict = tokenizer.prepare_seq2seq_batch(
|
59 |
+
question="What is the Carnot engine?",
|
60 |
+
n_docs=5,
|
61 |
+
return_tensors="pt"
|
62 |
+
)
|
63 |
+
generated = model.generate(**input_dict)
|
64 |
+
print(tokenizer.batch_decode(generated, skip_special_tokens=True))
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
[More Information Needed]
|
69 |
|
70 |
### Downstream Use [optional]
|