load model
Browse files- src/streamlit_app.py +2 -4
src/streamlit_app.py
CHANGED
|
@@ -74,10 +74,8 @@ def preprocess_function(examples, tokenizer):
|
|
| 74 |
return {key: tensor.to(device) for key, tensor in inputs.items()}
|
| 75 |
|
| 76 |
def generate_q(context, answer):
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
tokenizer = AutoTokenizer.from_pretrained('shnl/inst-qg-vinewsqa-vit5')
|
| 80 |
-
model = AutoModelForSeq2SeqLM.from_pretrained('shnl/inst-qg-vinewsqa-vit5')
|
| 81 |
instruction_qg = 'Hãy tạo ra câu hỏi từ nội dung của ngữ cảnh và câu trả lời dưới đây.',
|
| 82 |
examples = {"input_seq": str("### Instruction: \n"
|
| 83 |
f"{instruction_qg} \n\n"
|
|
|
|
| 74 |
return {key: tensor.to(device) for key, tensor in inputs.items()}
|
| 75 |
|
| 76 |
def generate_q(context, answer):
|
| 77 |
+
tokenizer = AutoTokenizer.from_pretrained('shnl/inst-qg-vinewsqa-vit5', cache_dir="/tmp/huggingface")
|
| 78 |
+
model = AutoModelForSeq2SeqLM.from_pretrained('shnl/inst-qg-vinewsqa-vit5', cache_dir="/tmp/huggingface")
|
|
|
|
|
|
|
| 79 |
instruction_qg = 'Hãy tạo ra câu hỏi từ nội dung của ngữ cảnh và câu trả lời dưới đây.',
|
| 80 |
examples = {"input_seq": str("### Instruction: \n"
|
| 81 |
f"{instruction_qg} \n\n"
|