Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
3 |
|
|
|
|
|
|
|
4 |
# Load the model and tokenizer
|
5 |
-
model =
|
6 |
-
tokenizer =
|
7 |
|
8 |
def generate_answer(question, distractors):
|
9 |
input_text = f"Question: {question} Distractors: {' '.join(distractors)}"
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
3 |
|
4 |
+
# Replace with your Hugging Face model repository path
|
5 |
+
model_repo_path = 'nxmwxm/correct_answer'
|
6 |
+
|
7 |
# Load the model and tokenizer
|
8 |
+
model = BartForConditionalGeneration.from_pretrained(model_repo_path)
|
9 |
+
tokenizer = BartTokenizer.from_pretrained(model_repo_path)
|
10 |
|
11 |
def generate_answer(question, distractors):
|
12 |
input_text = f"Question: {question} Distractors: {' '.join(distractors)}"
|