Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,10 @@ import torch
|
|
3 |
import gradio as gr
|
4 |
|
5 |
# Charger le tokenizer depuis Hugging Face Spaces
|
6 |
-
tokenizer = AutoTokenizer.from_pretrained("Dofla/
|
7 |
|
8 |
# Charger le modèle depuis Hugging Face Spaces
|
9 |
-
model = AutoModelForQuestionAnswering.from_pretrained("Dofla/
|
10 |
def answer_question(context, question):
|
11 |
inputs = tokenizer.encode_plus(question, context, return_tensors="pt", padding=True, truncation=True)
|
12 |
start_logits, end_logits = model(**inputs)
|
|
|
3 |
import gradio as gr
|
4 |
|
5 |
# Charger le tokenizer depuis Hugging Face Spaces
|
6 |
+
tokenizer = AutoTokenizer.from_pretrained("Dofla/roberta-base")
|
7 |
|
8 |
# Charger le modèle depuis Hugging Face Spaces
|
9 |
+
model = AutoModelForQuestionAnswering.from_pretrained("Dofla/roberta-base")
|
10 |
def answer_question(context, question):
|
11 |
inputs = tokenizer.encode_plus(question, context, return_tensors="pt", padding=True, truncation=True)
|
12 |
start_logits, end_logits = model(**inputs)
|