Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,13 @@ import streamlit as st
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# Define the path to the saved model
|
5 |
-
model_path = './QAModel'
|
6 |
|
7 |
# Load the question-answering pipeline
|
8 |
qa_pipeline = pipeline("question-answering", model=model_path, tokenizer=model_path)
|
9 |
|
10 |
# Load the context from a file
|
11 |
-
context_file = '
|
12 |
|
13 |
with open(context_file, 'r', encoding='utf-8') as f:
|
14 |
default_context = f.read()
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# Define the path to the saved model
|
5 |
+
model_path = './QAModel'
|
6 |
|
7 |
# Load the question-answering pipeline
|
8 |
qa_pipeline = pipeline("question-answering", model=model_path, tokenizer=model_path)
|
9 |
|
10 |
# Load the context from a file
|
11 |
+
context_file = 'contexts.txt'
|
12 |
|
13 |
with open(context_file, 'r', encoding='utf-8') as f:
|
14 |
default_context = f.read()
|