Dofla commited on
Commit
244a521
·
verified ·
1 Parent(s): 8f6c1bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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/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)
 
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)