Spaces:
Runtime error
Runtime error
Commit
·
3fe0fdb
1
Parent(s):
ea3279e
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,21 @@
|
|
| 1 |
import time
|
| 2 |
import streamlit as st
|
| 3 |
import requests
|
| 4 |
-
BERT_LARGE = "https://api-inference.huggingface.co/models/deepset/bert-large-uncased-whole-word-masking-squad2"
|
| 5 |
API_URL = "https://api-inference.huggingface.co/models/distilbert-base-cased-distilled-squad"
|
| 6 |
headers = {"Authorization": "Bearer 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"}
|
| 7 |
|
| 8 |
|
| 9 |
st.title("question-answering-demo")
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
text_input = st.text_area("Enter some context👇")
|
| 12 |
text_question = st.text_input("Enter a question regarding that context👇")
|
| 13 |
|
|
|
|
| 1 |
import time
|
| 2 |
import streamlit as st
|
| 3 |
import requests
|
|
|
|
| 4 |
API_URL = "https://api-inference.huggingface.co/models/distilbert-base-cased-distilled-squad"
|
| 5 |
headers = {"Authorization": "Bearer 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"}
|
| 6 |
|
| 7 |
|
| 8 |
st.title("question-answering-demo")
|
| 9 |
+
st.selectbox('Select a model', ('distilbert-base-cased-distilled-squad', 'roberta-base-squad2-distilled', 'xlm-roberta-large-squad2', 'bert-large-cased-whole-word-masking-finetuned-squad'))
|
| 10 |
+
if option == "distilbert-base-cased-distilled-squad":
|
| 11 |
+
API_URL = 'https://api-inference.huggingface.co/models/distilbert-base-cased-distilled-squad'
|
| 12 |
+
elif option == 'roberta-base-squad2-distilled':
|
| 13 |
+
API_URL = 'https://api-inference.huggingface.co/models/deepset/roberta-base-squad2-distilled'
|
| 14 |
+
elif option == 'xlm-roberta-large-squad2':
|
| 15 |
+
API_URL = "https://api-inference.huggingface.co/models/deepset/xlm-roberta-large-squad2"
|
| 16 |
+
if option == 'bert-large-cased-whole-word-masking-finetuned-squad':
|
| 17 |
+
API_URL = 'https://api-inference.huggingface.co/models/bert-large-cased-whole-word-masking-finetuned-squad'
|
| 18 |
+
st.write(API_URL)
|
| 19 |
text_input = st.text_area("Enter some context👇")
|
| 20 |
text_question = st.text_input("Enter a question regarding that context👇")
|
| 21 |
|