Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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,
|