Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ def inference(txt):
|
|
49 |
inference_tokenizer, tokenized_data = inference_tokenize(input_=txt, n_tokens=INPUT_N_TOKENS)
|
50 |
pred = model.generate(**tokenized_data, max_new_tokens=TARGET_N_TOKENS, num_beams=4)
|
51 |
result = [process_result(inference_tokenizer.decode(p, skip_special_tokens=True)) for p in pred]
|
52 |
-
logging.warning(result)
|
53 |
return result
|
54 |
except:
|
55 |
logging.warning(traceback.format_exc())
|
@@ -154,8 +154,7 @@ def main():
|
|
154 |
try:
|
155 |
st.info("Rewriting the text. This takes time.", icon="ℹ️")
|
156 |
input_txt, paraphrased_txt = inference_long_text(input_txt, n_sents)
|
157 |
-
|
158 |
-
paraphrased_txt = "<br><br>".join(paraphrased_txt)
|
159 |
except Exception as e:
|
160 |
paraphrased_txt = None
|
161 |
paraphrase_error = str(e)
|
|
|
49 |
inference_tokenizer, tokenized_data = inference_tokenize(input_=txt, n_tokens=INPUT_N_TOKENS)
|
50 |
pred = model.generate(**tokenized_data, max_new_tokens=TARGET_N_TOKENS, num_beams=4)
|
51 |
result = [process_result(inference_tokenizer.decode(p, skip_special_tokens=True)) for p in pred]
|
52 |
+
logging.warning(f'paraphrased_result: {result}')
|
53 |
return result
|
54 |
except:
|
55 |
logging.warning(traceback.format_exc())
|
|
|
154 |
try:
|
155 |
st.info("Rewriting the text. This takes time.", icon="ℹ️")
|
156 |
input_txt, paraphrased_txt = inference_long_text(input_txt, n_sents)
|
157 |
+
|
|
|
158 |
except Exception as e:
|
159 |
paraphrased_txt = None
|
160 |
paraphrase_error = str(e)
|