Spaces:
Sleeping
Sleeping
Truong-Phuc Nguyen
commited on
Commit
•
769c0ce
1
Parent(s):
19b9973
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ context = st.sidebar.text_area(label='Nội dung văn bản pháp luật Việt
|
|
10 |
device = 0 if torch.cuda.is_available() else -1
|
11 |
if 'model' not in st.session_state:
|
12 |
print('Some errors occured!')
|
13 |
-
st.session_state.model = pipeline("question-answering", model='./
|
14 |
|
15 |
def get_answer(context, question):
|
16 |
return st.session_state.model(context=context, question=question, max_answer_len=512)
|
|
|
10 |
device = 0 if torch.cuda.is_available() else -1
|
11 |
if 'model' not in st.session_state:
|
12 |
print('Some errors occured!')
|
13 |
+
st.session_state.model = pipeline("question-answering", model='./model', device=device)
|
14 |
|
15 |
def get_answer(context, question):
|
16 |
return st.session_state.model(context=context, question=question, max_answer_len=512)
|