Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,22 +5,15 @@ import pdfplumber
|
|
| 5 |
import os
|
| 6 |
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
| 7 |
|
| 8 |
-
|
| 9 |
-
n_epochs = 2
|
| 10 |
-
base_LM_model = "roberta-base"
|
| 11 |
-
max_seq_len = 386
|
| 12 |
-
learning_rate = 3e-5
|
| 13 |
-
warmup_proportion = 0.2
|
| 14 |
-
doc_stride = 128
|
| 15 |
-
max_query_length = 64
|
| 16 |
|
| 17 |
|
| 18 |
def AImodel(text,questionText):
|
| 19 |
-
model_name = "
|
| 20 |
|
| 21 |
|
| 22 |
# a) Get predictions
|
| 23 |
-
nlp = pipeline('
|
| 24 |
QA_input = {
|
| 25 |
'question': questionText,
|
| 26 |
'context': text
|
|
|
|
| 5 |
import os
|
| 6 |
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
| 7 |
|
| 8 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
def AImodel(text,questionText):
|
| 12 |
+
model_name = "meta-llama/Meta-Llama-3-8B"
|
| 13 |
|
| 14 |
|
| 15 |
# a) Get predictions
|
| 16 |
+
nlp = pipeline('text-generation', model=model_name, tokenizer=model_name)
|
| 17 |
QA_input = {
|
| 18 |
'question': questionText,
|
| 19 |
'context': text
|