mou3az commited on
Commit
91bbf8a
·
verified ·
1 Parent(s): f32742c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -54,12 +54,12 @@ metrics:
54
 
55
  ```python
56
  def get_question(context, answer):
57
- device = next(L_model.parameters()).device
58
  input_text = f"Given the context '{context}' and the answer '{answer}', what question can be asked?"
59
- encoding = G_tokenizer.encode_plus(input_text, padding=True, return_tensors="pt").to(device)
60
 
61
- output_tokens = L_model.generate(**encoding, early_stopping=True, num_beams=5, num_return_sequences=1, no_repeat_ngram_size=2, max_length=100)
62
- out = G_tokenizer.decode(output_tokens[0], skip_special_tokens=True).replace("question:", "").strip()
63
 
64
  return out
65
  ```
 
54
 
55
  ```python
56
  def get_question(context, answer):
57
+ device = next(QG_model.parameters()).device
58
  input_text = f"Given the context '{context}' and the answer '{answer}', what question can be asked?"
59
+ encoding = QG_tokenizer.encode_plus(input_text, padding=True, return_tensors="pt").to(device)
60
 
61
+ output_tokens = QG_model.generate(**encoding, early_stopping=True, num_beams=5, num_return_sequences=1, no_repeat_ngram_size=2, max_length=100)
62
+ out = QG_tokenizer.decode(output_tokens[0], skip_special_tokens=True).replace("question:", "").strip()
63
 
64
  return out
65
  ```