Spaces:
Runtime error
Runtime error
Commit
·
49e0baa
1
Parent(s):
4281dd8
Initial Commit
Browse files- app.py +12 -0
- requirements.txt +2 -0
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from transformers import AutoTokenizer,AutoModelForQuestionAnswering
|
3 |
+
from transformers import pipeline
|
4 |
+
model=AutoModelForQuestionAnswering.from_pretrained('abhilash1910/albert-squad-v2')
|
5 |
+
tokenizer=AutoTokenizer.from_pretrained('abhilash1910/albert-squad-v2')
|
6 |
+
nlp_QA=pipeline('question-answering',model=model,tokenizer=tokenizer)
|
7 |
+
QA_inp={
|
8 |
+
'question': 'How many parameters does Bert large have?',
|
9 |
+
'context': 'Bert large is really big... it has 24 layers, for a total of 340M parameters.Altogether it is 1.34 GB so expect it to take a couple minutes to download to your Colab instance.'
|
10 |
+
}
|
11 |
+
result=nlp_QA(QA_inp)
|
12 |
+
result
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
torch
|
2 |
+
transformers
|