rasyosef commited on
Commit
f0a4462
1 Parent(s): 33c366f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -82,7 +82,7 @@ def get_retrieval_qa_chain(text_file, hf_model):
82
 
83
  # Generates response using the question answering chain defined earlier
84
  def generate(question, answer, text_file, max_new_tokens):
85
- streamer = TextIteratorStreamer(tokenizer=tokenizer, skip_prompt=True)
86
  phi2_pipeline = pipeline(
87
  "text-generation", tokenizer=tokenizer, model=model, max_new_tokens=max_new_tokens,
88
  pad_token_id=tokenizer.eos_token_id, eos_token_id=tokenizer.eos_token_id,
 
82
 
83
  # Generates response using the question answering chain defined earlier
84
  def generate(question, answer, text_file, max_new_tokens):
85
+ streamer = TextIteratorStreamer(tokenizer=tokenizer, skip_prompt=True, skip_special_tokens=True, timeout=300.0)
86
  phi2_pipeline = pipeline(
87
  "text-generation", tokenizer=tokenizer, model=model, max_new_tokens=max_new_tokens,
88
  pad_token_id=tokenizer.eos_token_id, eos_token_id=tokenizer.eos_token_id,