yakine commited on
Commit
d7e7353
·
verified ·
1 Parent(s): 8cdfbf3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -97,7 +97,7 @@ def extract_answer(context: str) -> str:
97
  def get_question(context: str, answer: str) -> str:
98
  """Generate a question based on the context and the candidate answer."""
99
  text = f"النص: {context} الإجابة: {answer} </s>"
100
- text_encoding = qa_tokenizer.encode_plus(text, return_tensors="pt").to(device)
101
 
102
  with torch.no_grad():
103
  generated_ids = qa_model.generate(
 
97
  def get_question(context: str, answer: str) -> str:
98
  """Generate a question based on the context and the candidate answer."""
99
  text = f"النص: {context} الإجابة: {answer} </s>"
100
+ text_encoding = qa_tokenizer.encode_plus(text, return_tensors="pt")
101
 
102
  with torch.no_grad():
103
  generated_ids = qa_model.generate(