Update app.py
Browse files
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")
|
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(
|