Spaces:
Runtime error
Runtime error
Benjamin Consolvo
commited on
Commit
·
773755f
1
Parent(s):
d1300f3
trying without distilbert model
Browse files
app.py
CHANGED
@@ -4,15 +4,15 @@ import time
|
|
4 |
import neural_compressor
|
5 |
from optimum.intel.neural_compressor import IncQuantizedModelForQuestionAnswering
|
6 |
|
7 |
-
|
8 |
-
model_id = "Intel/distilbert-base-uncased-squadv1.1-sparse-80-1x4-block-pruneofa-int8"
|
9 |
int8_model = IncQuantizedModelForQuestionAnswering.from_pretrained(model_id)
|
10 |
|
11 |
# sparse_qa_pipeline = pipeline(task="question-answering",model="Intel/bert-base-uncased-squadv1.1-sparse-80-1x4-block-pruneofa")
|
12 |
# sparse_qa_pipeline = pipeline(task="question-answering",model="Intel/distilbert-base-uncased-squadv1.1-sparse-80-1x4-block-pruneofa-int8")
|
13 |
|
14 |
-
|
15 |
-
dense_qa_pipeline = pipeline(task="question-answering",model="distilbert-base-uncased-distilled-squad")
|
16 |
|
17 |
|
18 |
def predict(context,question):
|
|
|
4 |
import neural_compressor
|
5 |
from optimum.intel.neural_compressor import IncQuantizedModelForQuestionAnswering
|
6 |
|
7 |
+
model_id = "Intel/bert-base-uncased-squadv1.1-sparse-80-1x4-block-pruneofa"
|
8 |
+
# model_id = "Intel/distilbert-base-uncased-squadv1.1-sparse-80-1x4-block-pruneofa-int8"
|
9 |
int8_model = IncQuantizedModelForQuestionAnswering.from_pretrained(model_id)
|
10 |
|
11 |
# sparse_qa_pipeline = pipeline(task="question-answering",model="Intel/bert-base-uncased-squadv1.1-sparse-80-1x4-block-pruneofa")
|
12 |
# sparse_qa_pipeline = pipeline(task="question-answering",model="Intel/distilbert-base-uncased-squadv1.1-sparse-80-1x4-block-pruneofa-int8")
|
13 |
|
14 |
+
dense_qa_pipeline = pipeline(task="question-answering",model="csarron/bert-base-uncased-squad-v1")
|
15 |
+
# dense_qa_pipeline = pipeline(task="question-answering",model="distilbert-base-uncased-distilled-squad")
|
16 |
|
17 |
|
18 |
def predict(context,question):
|